]> granicus.if.org Git - curl/commitdiff
xattr: portability fix
authorYang Tse <yangsita@gmail.com>
Wed, 10 Nov 2010 17:39:44 +0000 (18:39 +0100)
committerYang Tse <yangsita@gmail.com>
Wed, 10 Nov 2010 17:39:44 +0000 (18:39 +0100)
src/xattr.c

index a770405c9fd7f84eb52afb73cb5c53c8ae0fb498..3fc264a7e29e43a7e20d3fe69df60ae1d8945cce 100644 (file)
@@ -55,7 +55,11 @@ int fwrite_xattr(CURL *curl, int fd)
     char *value = NULL;
     CURLcode rc = curl_easy_getinfo(curl, mappings[i].info, &value);
     if ( rc == CURLE_OK && value ) {
+#ifdef HAVE_FSETXATTR_6
+      err = fsetxattr( fd, mappings[i].attr, value, strlen(value), 0, 0 );
+#elif defined(HAVE_FSETXATTR_5)
       err = fsetxattr( fd, mappings[i].attr, value, strlen(value), 0 );
+#endif
     }
     i++;
   }