aboutsummaryrefslogtreecommitdiff
path: root/kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'kill.c')
-rw-r--r--kill.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kill.c b/kill.c
index db4842457..93f02eab4 100644
--- a/kill.c
+++ b/kill.c
@@ -222,12 +222,15 @@ extern int kill_main(int argc, char **argv)
222 } 222 }
223#ifdef BB_KILLALL 223#ifdef BB_KILLALL
224 else { 224 else {
225 pid_t myPid=getpid();
225 /* Looks like they want to do a killall. Do that */ 226 /* Looks like they want to do a killall. Do that */
226 while (--argc >= 0) { 227 while (--argc >= 0) {
227 pid_t* pidList; 228 pid_t* pidList;
228 229
229 pidList = findPidByName( *argv); 230 pidList = findPidByName( *argv);
230 for(; pidList && pidList!=0; pidList++) { 231 for(; pidList && *pidList!=0; pidList++) {
232 if (*pidList==myPid)
233 continue;
231 if (kill(*pidList, sig) != 0) 234 if (kill(*pidList, sig) != 0)
232 fatalError( "Could not kill pid '%d': %s\n", *pidList, strerror(errno)); 235 fatalError( "Could not kill pid '%d': %s\n", *pidList, strerror(errno));
233 } 236 }