diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-12-25 11:23:44 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-12-25 13:01:34 +0000 |
commit | 4ff5d32a6b30601b36a39a6bdd3a9c7996303957 (patch) | |
tree | ee7f8c8fc7b4345869e8c41da91f413864c25e11 /src | |
parent | ed16a1695f40e6b3dee6c7cf091eecb8839f88b9 (diff) | |
download | curl-4ff5d32a6b30601b36a39a6bdd3a9c7996303957.tar.gz |
tool_xattr: Use 'CURLcode result' for curl result codes
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_xattr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tool_xattr.c b/src/tool_xattr.c index b2666d973..da0cad67a 100644 --- a/src/tool_xattr.c +++ b/src/tool_xattr.c @@ -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 * 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 err = 0; + /* loop through all xattr-curlinfo pairs and abort on a set error */ while(err == 0 && mappings[i].attr != NULL) { char *value = NULL; - CURLcode rc = curl_easy_getinfo(curl, mappings[i].info, &value); - if(rc == CURLE_OK && value) { + CURLcode result = curl_easy_getinfo(curl, mappings[i].info, &value); + if(!result && value) { #ifdef HAVE_FSETXATTR_6 err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0); #elif defined(HAVE_FSETXATTR_5) @@ -75,6 +76,7 @@ int fwrite_xattr(CURL *curl, int fd) } i++; } + return err; } #else @@ -82,6 +84,7 @@ int fwrite_xattr(CURL *curl, int fd) { (void)curl; (void)fd; + return 0; } #endif |