public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Fix setxattr return value on replacing
@ 2024-06-10 20:08 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2024-06-10 20:08 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ed06248019908dd4f286552594ac3ec844ef3da4
commit ed06248019908dd4f286552594ac3ec844ef3da4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Mon Jun 10 22:00:20 2024 +0200
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.
Diff:
---
hurd/xattr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hurd/xattr.c b/hurd/xattr.c
index f613d47c83..1a84c90db8 100644
--- a/hurd/xattr.c
+++ b/hurd/xattr.c
@@ -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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-10 20:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 20:08 [glibc] hurd: Fix setxattr return value on replacing Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).