tool_xattr: Use 'CURLcode result' for curl result codes
This commit is contained in:
parent
ed16a1695f
commit
4ff5d32a6b
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -56,11 +56,12 @@ int fwrite_xattr(CURL *curl, int fd)
|
|||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
/* loop through all xattr-curlinfo pairs and abort on a set error */
|
/* loop through all xattr-curlinfo pairs and abort on a set error */
|
||||||
while(err == 0 && mappings[i].attr != NULL) {
|
while(err == 0 && mappings[i].attr != NULL) {
|
||||||
char *value = NULL;
|
char *value = NULL;
|
||||||
CURLcode rc = curl_easy_getinfo(curl, mappings[i].info, &value);
|
CURLcode result = curl_easy_getinfo(curl, mappings[i].info, &value);
|
||||||
if(rc == CURLE_OK && value) {
|
if(!result && value) {
|
||||||
#ifdef HAVE_FSETXATTR_6
|
#ifdef HAVE_FSETXATTR_6
|
||||||
err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
|
err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
|
||||||
#elif defined(HAVE_FSETXATTR_5)
|
#elif defined(HAVE_FSETXATTR_5)
|
||||||
@ -75,6 +76,7 @@ int fwrite_xattr(CURL *curl, int fd)
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -82,6 +84,7 @@ int fwrite_xattr(CURL *curl, int fd)
|
|||||||
{
|
{
|
||||||
(void)curl;
|
(void)curl;
|
||||||
(void)fd;
|
(void)fd;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user