| 1 |
Index: dietlibc-0.30/lib/__nice.c |
| 2 |
=================================================================== |
| 3 |
--- dietlibc-0.30.orig/lib/__nice.c |
| 4 |
+++ dietlibc-0.30/lib/__nice.c |
| 5 |
@@ -1,9 +1,14 @@ |
| 6 |
#include "syscalls.h" |
| 7 |
#include <sys/time.h> |
| 8 |
#include <sys/resource.h> |
| 9 |
+#include <errno.h> |
| 10 |
|
| 11 |
#ifndef __NR_nice |
| 12 |
int nice(int i) { |
| 13 |
- return setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i); |
| 14 |
+ if (setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i) == -1) { |
| 15 |
+ errno=EPERM; |
| 16 |
+ return -1; |
| 17 |
+ } |
| 18 |
+ return getpriority(PRIO_PROCESS,0); |
| 19 |
} |
| 20 |
#endif |