When XATTR_REPLACE is set we shall succeed when the value already
exists, and fail with ENODATA otherwise, instead of the converse.
---
 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)
-- 
2.43.0


Reply via email to