aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-06 07:43:58 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-06 07:43:58 +0000
commit38330e68a14f4ac7ceb608371c6b339f40e79a1a (patch)
treea7276959fc8907e0ab78c003963bb852307dabff /procps
parenteacacae5f56904245910aeb048d505477fa74b6a (diff)
downloadbusybox-w32-38330e68a14f4ac7ceb608371c6b339f40e79a1a.tar.gz
busybox-w32-38330e68a14f4ac7ceb608371c6b339f40e79a1a.tar.bz2
busybox-w32-38330e68a14f4ac7ceb608371c6b339f40e79a1a.zip
Fixup segfault on 'kill -q'
git-svn-id: svn://busybox.net/trunk/busybox@7168 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c10
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
35static const int KILL = 0; 35#define KILL 0
36static const int KILLALL = 1; 36#define KILLALL 1
37 37
38extern int kill_main(int argc, char **argv) 38extern 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();