summaryrefslogtreecommitdiff
path: root/sysdeps/posix/nice.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/nice.c')
-rw-r--r--sysdeps/posix/nice.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdeps/posix/nice.c b/sysdeps/posix/nice.c
index 42bb99b7e1..ae82618767 100644
--- a/sysdeps/posix/nice.c
+++ b/sysdeps/posix/nice.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -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);
}