summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordcashman <dcashman@google.com>2016-02-23 08:48:03 -0800
committerdcashman <dcashman@google.com>2016-02-23 09:16:16 -0800
commit5ff2a33bf370604a6260af338dde06cd67deaba2 (patch)
tree056a2092c3610b4370290b7737a2beab9176b834
parentae9473b3eb92d952fc04d3846b376c412f992553 (diff)
downloadlibselinux-5ff2a33bf370604a6260af338dde06cd67deaba2.tar.gz
Correct errno value.
Returning -{ERRVAL} is a kernel return convention, but userspace errno assignment and associated functions deal with the positive numbers. Correct the errno assignment introduced in commit: 78899de14b476a759f4839eae4879d47e36a624a. (cherry-pick of commit: 034c53e93a736f8b6f9aac90938ef65ffcaac9da) AOSP Bug: 200617 Bug: 27111481 Change-Id: I174dac888c06d096d361eab5efcde169f7899726
-rw-r--r--src/procattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/procattr.c b/src/procattr.c
index e88e224..a55465a 100644
--- a/src/procattr.c
+++ b/src/procattr.c
@@ -34,7 +34,7 @@ static int openattr(pid_t pid, const char *attr, int flags)
tid = gettid();
rc = asprintf(&path, "/proc/self/task/%d/attr/%s", tid, attr);
} else {
- errno = -EINVAL;
+ errno = EINVAL;
return -1;
}
if (rc < 0)