diff options
author | Pavel Roskin <proski@gnu.org> | 2000-06-06 18:10:17 +0000 |
---|---|---|
committer | Pavel Roskin <proski@gnu.org> | 2000-06-06 18:10:17 +0000 |
commit | 700a5aed75dca84eba1714aa44d698283be68d63 (patch) | |
tree | 0772df40000bdaafbad2be97437e39b1dd67f1fd | |
parent | 517cab761f99c7c32193940459e89f258dc585b3 (diff) | |
download | busybox-w32-700a5aed75dca84eba1714aa44d698283be68d63.tar.gz busybox-w32-700a5aed75dca84eba1714aa44d698283be68d63.tar.bz2 busybox-w32-700a5aed75dca84eba1714aa44d698283be68d63.zip |
Fixed exit status for killall
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | kill.c | 6 | ||||
-rw-r--r-- | procps/kill.c | 6 |
3 files changed, 11 insertions, 2 deletions
@@ -59,6 +59,7 @@ | |||
59 | with traditional implementations -- Pavel Roskin. | 59 | with traditional implementations -- Pavel Roskin. |
60 | * "mount" now reports errors from nfsmount() and assumes NFS mount | 60 | * "mount" now reports errors from nfsmount() and assumes NFS mount |
61 | if ':' is present in the device name - Pavel Roskin | 61 | if ':' is present in the device name - Pavel Roskin |
62 | * Fixed exit status for killall - Pavel Roskin | ||
62 | * More doc updates | 63 | * More doc updates |
63 | 64 | ||
64 | 65 | ||
@@ -228,14 +228,17 @@ extern int kill_main(int argc, char **argv) | |||
228 | } | 228 | } |
229 | #ifdef BB_KILLALL | 229 | #ifdef BB_KILLALL |
230 | else { | 230 | else { |
231 | int all_found = TRUE; | ||
231 | pid_t myPid=getpid(); | 232 | pid_t myPid=getpid(); |
232 | /* Looks like they want to do a killall. Do that */ | 233 | /* Looks like they want to do a killall. Do that */ |
233 | while (--argc >= 0) { | 234 | while (--argc >= 0) { |
234 | pid_t* pidList; | 235 | pid_t* pidList; |
235 | 236 | ||
236 | pidList = findPidByName( *argv); | 237 | pidList = findPidByName( *argv); |
237 | if (!pidList) | 238 | if (!pidList) { |
239 | all_found = FALSE; | ||
238 | errorMsg( "%s: no process killed\n", *argv); | 240 | errorMsg( "%s: no process killed\n", *argv); |
241 | } | ||
239 | 242 | ||
240 | for(; pidList && *pidList!=0; pidList++) { | 243 | for(; pidList && *pidList!=0; pidList++) { |
241 | if (*pidList==myPid) | 244 | if (*pidList==myPid) |
@@ -248,6 +251,7 @@ extern int kill_main(int argc, char **argv) | |||
248 | * upon exit, so we can save a byte or two */ | 251 | * upon exit, so we can save a byte or two */ |
249 | argv++; | 252 | argv++; |
250 | } | 253 | } |
254 | exit (all_found); | ||
251 | } | 255 | } |
252 | #endif | 256 | #endif |
253 | 257 | ||
diff --git a/procps/kill.c b/procps/kill.c index 1f1bee48b..75277d962 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -228,14 +228,17 @@ extern int kill_main(int argc, char **argv) | |||
228 | } | 228 | } |
229 | #ifdef BB_KILLALL | 229 | #ifdef BB_KILLALL |
230 | else { | 230 | else { |
231 | int all_found = TRUE; | ||
231 | pid_t myPid=getpid(); | 232 | pid_t myPid=getpid(); |
232 | /* Looks like they want to do a killall. Do that */ | 233 | /* Looks like they want to do a killall. Do that */ |
233 | while (--argc >= 0) { | 234 | while (--argc >= 0) { |
234 | pid_t* pidList; | 235 | pid_t* pidList; |
235 | 236 | ||
236 | pidList = findPidByName( *argv); | 237 | pidList = findPidByName( *argv); |
237 | if (!pidList) | 238 | if (!pidList) { |
239 | all_found = FALSE; | ||
238 | errorMsg( "%s: no process killed\n", *argv); | 240 | errorMsg( "%s: no process killed\n", *argv); |
241 | } | ||
239 | 242 | ||
240 | for(; pidList && *pidList!=0; pidList++) { | 243 | for(; pidList && *pidList!=0; pidList++) { |
241 | if (*pidList==myPid) | 244 | if (*pidList==myPid) |
@@ -248,6 +251,7 @@ extern int kill_main(int argc, char **argv) | |||
248 | * upon exit, so we can save a byte or two */ | 251 | * upon exit, so we can save a byte or two */ |
249 | argv++; | 252 | argv++; |
250 | } | 253 | } |
254 | exit (all_found); | ||
251 | } | 255 | } |
252 | #endif | 256 | #endif |
253 | 257 | ||