summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2018-12-17 14:33:55 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2018-12-17 14:43:28 +0100
commit384983af853bd800c3ddf2a4f8004967888fda8d (patch)
tree2b6456207e1000cd4910e2f22d965a9240aec672
parent14adc898a36948267bfe5c63b399996879e94c98 (diff)
downloadattr-384983af853bd800c3ddf2a4f8004967888fda8d.tar.gz
attr_multi, attr_multif: Don't set errno to -EINVAL
When attr_multi or attr_multif are called with an invalid am_opcode, they fail with errno set to -EINVAL. Instead, the errno value should be positive.
-rw-r--r--libattr/libattr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libattr/libattr.c b/libattr/libattr.c
index d6668af..8180c3f 100644
--- a/libattr/libattr.c
+++ b/libattr/libattr.c
@@ -391,7 +391,7 @@ attr_single(const char *path, attr_multiop_t *op, int flags)
{
int r = -1;
- errno = -EINVAL;
+ errno = EINVAL;
flags |= op->am_flags;
if (op->am_opcode == ATTR_OP_GET)
r = attr_get(path, op->am_attrname, op->am_attrvalue,
@@ -409,7 +409,7 @@ attr_singlef(const int fd, attr_multiop_t *op, int flags)
{
int r = -1;
- errno = -EINVAL;
+ errno = EINVAL;
flags |= op->am_flags;
if (op->am_opcode == ATTR_OP_GET)
r = attr_getf(fd, op->am_attrname, op->am_attrvalue,