diff options
Diffstat (limited to 'src/xattr.c')
-rw-r--r-- | src/xattr.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/xattr.c b/src/xattr.c index fbc09c207..1047c8a63 100644 --- a/src/xattr.c +++ b/src/xattr.c @@ -1,9 +1,35 @@ -#include <sys/types.h> -#include <sys/xattr.h> /* include header from libc, not from libattr */ -#include <string.h> +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 2010, Daniel Stenberg, <daniel@haxx.se>, et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms + * are also available at http://curl.haxx.se/docs/copyright.html. + * + * You may opt to use, copy, modify, merge, publish, distribute and/or sell + * copies of the Software, and permit persons to whom the Software is + * furnished to do so, under the terms of the COPYING file. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ***************************************************************************/ + +/* client-local setup.h */ +#include "setup.h" #include <curl/curl.h> #include "xattr.h" +#ifdef HAVE_SETXATTR +#include <sys/types.h> +#include <string.h> +#include <sys/xattr.h> /* include header from libc, not from libattr */ + /* mapping table of curl metadata to extended attribute names */ static struct xattr_mapping { char *attr; /* name of the xattr */ @@ -20,7 +46,7 @@ static struct xattr_mapping { /* store metadata from the curl request alongside the downloaded * file using extended attributes */ -int write_xattr( CURL *curl, const char *filename ) +int write_xattr(CURL *curl, const char *filename) { int i = 0; int err = 0; @@ -35,3 +61,11 @@ int write_xattr( CURL *curl, const char *filename ) } return err; } +#else +int write_xattr(CURL *curl, const char *filename) +{ + (void)curl; + (void)filename; + return 0; +} +#endif |