diff options
author | Charles Manning <cdhmanning@gmail.com> | 2010-07-01 13:41:16 +1200 |
---|---|---|
committer | Charles Manning <cdhmanning@gmail.com> | 2010-07-01 13:41:16 +1200 |
commit | 196cd2318144d4de74087e318f312c8ab6d77770 (patch) | |
tree | 6c2374e3dab61d4f17d623486aab5cbb3392d5e9 /yaffs_nameval.c | |
parent | c1399b62aaa71a3da498b5fa67adb25e59181ab0 (diff) |
yaffs Fix xattr error codes
There were some incorrect error codes.
Now returns
ENODATA if an object does not have the requested xattr.
ERANGE if the buffer is too small to accept the requested xattr.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Diffstat (limited to 'yaffs_nameval.c')
-rw-r--r-- | yaffs_nameval.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/yaffs_nameval.c b/yaffs_nameval.c index e15b647..4835ccf 100644 --- a/yaffs_nameval.c +++ b/yaffs_nameval.c @@ -80,7 +80,7 @@ int nval_del(char *xb, int xb_size, const char *name) memset(xb + (xb_size - size),0,size); return 0; } else - return -ENOENT; + return -ENODATA; } int nval_set(char *xb, int xb_size, const char *name, const char *buf, int bsize, int flags) @@ -97,7 +97,7 @@ int nval_set(char *xb, int xb_size, const char *name, const char *buf, int bsize if(flags & XATTR_CREATE && pos >= 0) return -EEXIST; if(flags & XATTR_REPLACE && pos < 0) - return -ENOENT; + return -ENODATA; start = nval_used(xb,xb_size); space = xb_size - start + size_exist; @@ -148,7 +148,10 @@ int nval_get(const char *xb, int xb_size, const char *name, char *buf, int bsize } } - return -ENOENT; + if(pos >= 0) + return -ERANGE; + else + return -ENODATA; } int nval_list(const char *xb, int xb_size, char *buf, int bsize) |