From 384983af853bd800c3ddf2a4f8004967888fda8d Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 17 Dec 2018 14:33:55 +0100 Subject: 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. --- libattr/libattr.c | 4 ++-- 1 file 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, -- cgit v1.2.1