From 0a0eaa8148287f67f422c2f18ab4daaf116c5913 Mon Sep 17 00:00:00 2001 From: Marc Andre Tanner Date: Fri, 17 Jun 2011 20:18:49 +0200 Subject: [PATCH] Fix {get,list}xattr The return value should be the size of the xattr not simply 0. Signed-off-by: Marc Andre Tanner --- ciopfs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ciopfs.c b/ciopfs.c index d2575da..04639db 100644 --- a/ciopfs.c +++ b/ciopfs.c @@ -847,32 +847,30 @@ static int ciopfs_setxattr(const char *path, const char *name, const char *value static int ciopfs_getxattr(const char *path, const char *name, char *value, size_t size) { - int ret = 0; char *p = map_path(path); if (unlikely(p == NULL)) return -ENOMEM; enter_user_context_effective(); int res = lgetxattr(p, name, value, size); if (res == -1) - ret = -errno; + res = -errno; leave_user_context_effective(); free(p); - return ret; + return res; } static int ciopfs_listxattr(const char *path, char *list, size_t size) { - int ret = 0; char *p = map_path(path); if (unlikely(p == NULL)) return -ENOMEM; enter_user_context_effective(); int res = llistxattr(p, list, size); if (res == -1) - ret = -errno; + res = -errno; leave_user_context_effective(); free(p); - return ret; + return res; } static int ciopfs_removexattr(const char *path, const char *name) -- 2.11.4.GIT