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>
+#ifndef ERANGE
+#define ERANGE 34
+#endif
+
+#ifndef ENODATA
+#define ENODATA 61
+#endif
+
#ifndef ENOTEMPTY
#define ENOTEMPTY 39
#endif
#ifndef ENOTEMPTY
#define ENOTEMPTY 39
#endif
int retval = 0;
if(obj->hdrChunk < 1)
int retval = 0;
if(obj->hdrChunk < 1)
buffer = yaffs_GetTempBuffer(dev, __LINE__);
if(!buffer)
buffer = yaffs_GetTempBuffer(dev, __LINE__);
if(!buffer)
memset(xb + (xb_size - size),0,size);
return 0;
} else
memset(xb + (xb_size - size),0,size);
return 0;
} else
}
int nval_set(char *xb, int xb_size, const char *name, const char *buf, int bsize, int flags)
}
int nval_set(char *xb, int xb_size, const char *name, const char *buf, int bsize, int flags)
if(flags & XATTR_CREATE && pos >= 0)
return -EEXIST;
if(flags & XATTR_REPLACE && pos < 0)
if(flags & XATTR_CREATE && pos >= 0)
return -EEXIST;
if(flags & XATTR_REPLACE && pos < 0)
start = nval_used(xb,xb_size);
space = xb_size - start + size_exist;
start = nval_used(xb,xb_size);
space = xb_size - start + size_exist;
+ if(pos >= 0)
+ return -ERANGE;
+ else
+ return -ENODATA;
}
int nval_list(const char *xb, int xb_size, char *buf, int bsize)
}
int nval_list(const char *xb, int xb_size, char *buf, int bsize)