1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 06:25:03 -05:00

curl: fix FreeBSD compiler warning in the --xattr code

Closes #3550
This commit is contained in:
Daniel Stenberg 2019-02-11 10:09:18 +01:00
parent 38d8e1bd4e
commit b49652ac66
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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));
{
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 = err < 0 ? err : 0;
err = (int)rc;
}
#endif
if(freeptr)
curl_free(value);