diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-17 20:29:00 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-17 20:29:00 +0000 |
commit | a7189f01a4a19a9c8852e84b322fc3d8cbda92eb (patch) | |
tree | 436e3ab7b6f055553199153e99f6b7589fb488ec /procps/renice.c | |
parent | 04c6386c45cd795617dd754066ac3bd6a62757cb (diff) | |
download | busybox-w32-a7189f01a4a19a9c8852e84b322fc3d8cbda92eb.tar.gz busybox-w32-a7189f01a4a19a9c8852e84b322fc3d8cbda92eb.tar.bz2 busybox-w32-a7189f01a4a19a9c8852e84b322fc3d8cbda92eb.zip |
add -Wundef, fix uncovered bugs
Diffstat (limited to 'procps/renice.c')
-rw-r--r-- | procps/renice.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/procps/renice.c b/procps/renice.c index bcaa94cf1..65674a4ee 100644 --- a/procps/renice.c +++ b/procps/renice.c | |||
@@ -20,23 +20,11 @@ | |||
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "busybox.h" | 22 | #include "busybox.h" |
23 | #include <stdio.h> | ||
24 | #include <stdlib.h> | ||
25 | #include <string.h> | ||
26 | #include <limits.h> | ||
27 | #include <errno.h> | ||
28 | #include <unistd.h> | ||
29 | #include <sys/resource.h> | 23 | #include <sys/resource.h> |
30 | 24 | ||
31 | #if (PRIO_PROCESS < CHAR_MIN) || (PRIO_PROCESS > CHAR_MAX) | 25 | void BUG_bad_PRIO_PROCESS(void); |
32 | #error Assumption violated : PRIO_PROCESS value | 26 | void BUG_bad_PRIO_PGRP(void); |
33 | #endif | 27 | void BUG_bad_PRIO_USER(void); |
34 | #if (PRIO_PGRP < CHAR_MIN) || (PRIO_PGRP > CHAR_MAX) | ||
35 | #error Assumption violated : PRIO_PGRP value | ||
36 | #endif | ||
37 | #if (PRIO_USER < CHAR_MIN) || (PRIO_USER > CHAR_MAX) | ||
38 | #error Assumption violated : PRIO_USER value | ||
39 | #endif | ||
40 | 28 | ||
41 | int renice_main(int argc, char **argv) | 29 | int renice_main(int argc, char **argv) |
42 | { | 30 | { |
@@ -49,6 +37,14 @@ int renice_main(int argc, char **argv) | |||
49 | unsigned who; | 37 | unsigned who; |
50 | char *arg; | 38 | char *arg; |
51 | 39 | ||
40 | /* Yes, they are not #defines in glibc 2.4! #if won't work */ | ||
41 | if (PRIO_PROCESS < CHAR_MIN || PRIO_PROCESS > CHAR_MAX) | ||
42 | BUG_bad_PRIO_PROCESS(); | ||
43 | if (PRIO_PGRP < CHAR_MIN || PRIO_PGRP > CHAR_MAX) | ||
44 | BUG_bad_PRIO_PGRP(); | ||
45 | if (PRIO_USER < CHAR_MIN || PRIO_USER > CHAR_MAX) | ||
46 | BUG_bad_PRIO_USER(); | ||
47 | |||
52 | arg = *++argv; | 48 | arg = *++argv; |
53 | 49 | ||
54 | /* Check if we are using a relative adjustment. */ | 50 | /* Check if we are using a relative adjustment. */ |