From 84895dca70f972df3842fb88f7b33b5d695cc599 Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Tue, 11 Aug 2015 23:40:00 -0700 Subject: Fix BZ #18086 -- nice resets errno to 0. --- sysdeps/posix/nice.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/posix/nice.c b/sysdeps/posix/nice.c index 42bb99b7e1..8f6daaffbf 100644 --- a/sysdeps/posix/nice.c +++ b/sysdeps/posix/nice.c @@ -36,16 +36,16 @@ nice (int incr) { if (errno != 0) return -1; - else - __set_errno (save); } result = __setpriority (PRIO_PROCESS, 0, prio + incr); if (result == -1) { if (errno == EACCES) - errno = EPERM; + __set_errno (EPERM); return -1; } + + __set_errno (save); return __getpriority (PRIO_PROCESS, 0); } -- cgit 1.4.1