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)
pos = nval_find(xb,xb_size,name, &size_exist);
- if(flags & NVAL_CREATE && pos >= 0)
+ if(flags & XATTR_CREATE && pos >= 0)
return -EEXIST;
- if(flags & NVAL_REPLACE && pos < 0)
- return -ENOENT;
+ if(flags & XATTR_REPLACE && pos < 0)
+ return -ENODATA;
start = nval_used(xb,xb_size);
space = xb_size - start + size_exist;
}
}
- return -ENOENT;
+ if(pos >= 0)
+ return -ERANGE;
+ else
+ return -ENODATA;
}
int nval_list(const char *xb, int xb_size, char *buf, int bsize)