aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2000-06-06 18:10:17 +0000
committerPavel Roskin <proski@gnu.org>2000-06-06 18:10:17 +0000
commit700a5aed75dca84eba1714aa44d698283be68d63 (patch)
tree0772df40000bdaafbad2be97437e39b1dd67f1fd
parent517cab761f99c7c32193940459e89f258dc585b3 (diff)
downloadbusybox-700a5aed75dca84eba1714aa44d698283be68d63.tar.gz
Fixed exit status for killall
-rw-r--r--Changelog1
-rw-r--r--kill.c6
-rw-r--r--procps/kill.c6
3 files changed, 11 insertions, 2 deletions
diff --git a/Changelog b/Changelog
index 7ac97dc71..da229a962 100644
--- a/Changelog
+++ b/Changelog
@@ -59,6 +59,7 @@
with traditional implementations -- Pavel Roskin.
* "mount" now reports errors from nfsmount() and assumes NFS mount
if ':' is present in the device name - Pavel Roskin
+ * Fixed exit status for killall - Pavel Roskin
* More doc updates
diff --git a/kill.c b/kill.c
index 1f1bee48b..75277d962 100644
--- a/kill.c
+++ b/kill.c
@@ -228,14 +228,17 @@ extern int kill_main(int argc, char **argv)
}
#ifdef BB_KILLALL
else {
+ int all_found = TRUE;
pid_t myPid=getpid();
/* Looks like they want to do a killall. Do that */
while (--argc >= 0) {
pid_t* pidList;
pidList = findPidByName( *argv);
- if (!pidList)
+ if (!pidList) {
+ all_found = FALSE;
errorMsg( "%s: no process killed\n", *argv);
+ }
for(; pidList && *pidList!=0; pidList++) {
if (*pidList==myPid)
@@ -248,6 +251,7 @@ extern int kill_main(int argc, char **argv)
* upon exit, so we can save a byte or two */
argv++;
}
+ exit (all_found);
}
#endif
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)
}
#ifdef BB_KILLALL
else {
+ int all_found = TRUE;
pid_t myPid=getpid();
/* Looks like they want to do a killall. Do that */
while (--argc >= 0) {
pid_t* pidList;
pidList = findPidByName( *argv);
- if (!pidList)
+ if (!pidList) {
+ all_found = FALSE;
errorMsg( "%s: no process killed\n", *argv);
+ }
for(; pidList && *pidList!=0; pidList++) {
if (*pidList==myPid)
@@ -248,6 +251,7 @@ extern int kill_main(int argc, char **argv)
* upon exit, so we can save a byte or two */
argv++;
}
+ exit (all_found);
}
#endif