hurd: Fix setxattr return value on replacing

When XATTR_REPLACE is set we shall succeed when the value already
exists, and fail with ENODATA otherwise, instead of the converse.
This commit is contained in:
Samuel Thibault 2024-06-10 22:00:20 +02:00
parent ba5a23422a
commit ed06248019

View File

@ -158,10 +158,9 @@ _hurd_xattr_set (io_t port, const char *name, const void *value, size_t size,
if (err)
return err;
if (bufsz > 0)
{
__munmap (buf, bufsz);
return ENODATA;
}
__munmap (buf, bufsz);
else
return ENODATA;
}
return __file_set_translator (port,
FS_TRANS_SET | ((flags & XATTR_CREATE)