summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/renice.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/procps/renice.c b/procps/renice.c
index bcaa94c..65674a4 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -20,23 +20,11 @@
*/
#include "busybox.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <errno.h>
-#include <unistd.h>
#include <sys/resource.h>
-#if (PRIO_PROCESS < CHAR_MIN) || (PRIO_PROCESS > CHAR_MAX)
-#error Assumption violated : PRIO_PROCESS value
-#endif
-#if (PRIO_PGRP < CHAR_MIN) || (PRIO_PGRP > CHAR_MAX)
-#error Assumption violated : PRIO_PGRP value
-#endif
-#if (PRIO_USER < CHAR_MIN) || (PRIO_USER > CHAR_MAX)
-#error Assumption violated : PRIO_USER value
-#endif
+void BUG_bad_PRIO_PROCESS(void);
+void BUG_bad_PRIO_PGRP(void);
+void BUG_bad_PRIO_USER(void);
int renice_main(int argc, char **argv)
{
@@ -49,6 +37,14 @@ int renice_main(int argc, char **argv)
unsigned who;
char *arg;
+ /* Yes, they are not #defines in glibc 2.4! #if won't work */
+ if (PRIO_PROCESS < CHAR_MIN || PRIO_PROCESS > CHAR_MAX)
+ BUG_bad_PRIO_PROCESS();
+ if (PRIO_PGRP < CHAR_MIN || PRIO_PGRP > CHAR_MAX)
+ BUG_bad_PRIO_PGRP();
+ if (PRIO_USER < CHAR_MIN || PRIO_USER > CHAR_MAX)
+ BUG_bad_PRIO_USER();
+
arg = *++argv;
/* Check if we are using a relative adjustment. */