diff options
Diffstat (limited to 'dietlibc/patches/0.30_pre20060621-r0/21_all_nice.patch')
-rw-r--r-- | dietlibc/patches/0.30_pre20060621-r0/21_all_nice.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dietlibc/patches/0.30_pre20060621-r0/21_all_nice.patch b/dietlibc/patches/0.30_pre20060621-r0/21_all_nice.patch new file mode 100644 index 0000000..641e6c3 --- /dev/null +++ b/dietlibc/patches/0.30_pre20060621-r0/21_all_nice.patch @@ -0,0 +1,20 @@ +Index: dietlibc-0.29/lib/__nice.c +=================================================================== +--- dietlibc-0.29.orig/lib/__nice.c ++++ dietlibc-0.29/lib/__nice.c +@@ -1,9 +1,14 @@ + #include "syscalls.h" + #include <sys/time.h> + #include <sys/resource.h> ++#include <errno.h> + + #ifndef __NR_nice + int nice(int i) { +- return setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i); ++ if (setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i) == -1) { ++ errno=EPERM; ++ return -1; ++ } ++ return getpriority(PRIO_PROCESS,0); + } + #endif |