diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-02-11 10:09:18 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-02-11 10:09:18 +0100 |
commit | 2f84513faf39a7cb10fa75b1570b0401ce3ebba2 (patch) | |
tree | 1689bf072d2a6984b4105e4a83be75f3d32428bf | |
parent | 81a9fe4e92e263621c2117fdeb1603fe576006ad (diff) | |
download | curl-bagder/freebsd-xattr.tar.gz |
curl: fix FreeBSD compiler warning in the --xattr codebagder/freebsd-xattr
-rw-r--r-- | src/tool_xattr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tool_xattr.c b/src/tool_xattr.c index 730381ba9..be5f024a6 100644 --- a/src/tool_xattr.c +++ b/src/tool_xattr.c @@ -111,11 +111,13 @@ int fwrite_xattr(CURL *curl, int fd) #elif defined(HAVE_FSETXATTR_5) err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0); #elif defined(__FreeBSD_version) - err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr, - value, strlen(value)); - /* FreeBSD's extattr_set_fd returns the length of the extended - attribute */ - err = err < 0 ? err : 0; + { + ssize_t rc = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, + mappings[i].attr, value, strlen(value)); + /* FreeBSD's extattr_set_fd returns the length of the extended + attribute */ + err = (int)rc; + } #endif if(freeptr) curl_free(value); |