diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-08-06 07:43:58 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-08-06 07:43:58 +0000 |
commit | 8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7 (patch) | |
tree | a7276959fc8907e0ab78c003963bb852307dabff | |
parent | c774efe317442ee8e62ce2c6594c5e57776a8eee (diff) | |
download | busybox-w32-8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7.tar.gz busybox-w32-8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7.tar.bz2 busybox-w32-8f4ef159f09e1b5d09f7f7d2fcbf9e4a78c375c7.zip |
Fixup segfault on 'kill -q'
-rw-r--r-- | procps/kill.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/kill.c b/procps/kill.c index f11623e01..22bb98a12 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -32,8 +32,8 @@ | |||
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #include "busybox.h" | 33 | #include "busybox.h" |
34 | 34 | ||
35 | static const int KILL = 0; | 35 | #define KILL 0 |
36 | static const int KILLALL = 1; | 36 | #define KILLALL 1 |
37 | 37 | ||
38 | extern int kill_main(int argc, char **argv) | 38 | extern int kill_main(int argc, char **argv) |
39 | { | 39 | { |
@@ -43,7 +43,7 @@ extern int kill_main(int argc, char **argv) | |||
43 | 43 | ||
44 | #ifdef CONFIG_KILLALL | 44 | #ifdef CONFIG_KILLALL |
45 | /* Figure out what we are trying to do here */ | 45 | /* Figure out what we are trying to do here */ |
46 | whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL; | 46 | whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL; |
47 | #else | 47 | #else |
48 | whichApp = KILL; | 48 | whichApp = KILL; |
49 | #endif | 49 | #endif |
@@ -91,7 +91,7 @@ extern int kill_main(int argc, char **argv) | |||
91 | quiet++; | 91 | quiet++; |
92 | argv++; | 92 | argv++; |
93 | argc--; | 93 | argc--; |
94 | if(argv[1][0] != '-'){ | 94 | if(argc<2 || argv[1][0] != '-'){ |
95 | goto do_it_now; | 95 | goto do_it_now; |
96 | } | 96 | } |
97 | } | 97 | } |
@@ -118,7 +118,7 @@ do_it_now: | |||
118 | argv++; | 118 | argv++; |
119 | } | 119 | } |
120 | 120 | ||
121 | } | 121 | } |
122 | #ifdef CONFIG_KILLALL | 122 | #ifdef CONFIG_KILLALL |
123 | else { | 123 | else { |
124 | pid_t myPid=getpid(); | 124 | pid_t myPid=getpid(); |