Fixed exit status for killall
This commit is contained in:
parent
517cab761f
commit
700a5aed75
@ -59,6 +59,7 @@
|
|||||||
with traditional implementations -- Pavel Roskin.
|
with traditional implementations -- Pavel Roskin.
|
||||||
* "mount" now reports errors from nfsmount() and assumes NFS mount
|
* "mount" now reports errors from nfsmount() and assumes NFS mount
|
||||||
if ':' is present in the device name - Pavel Roskin
|
if ':' is present in the device name - Pavel Roskin
|
||||||
|
* Fixed exit status for killall - Pavel Roskin
|
||||||
* More doc updates
|
* More doc updates
|
||||||
|
|
||||||
|
|
||||||
|
6
kill.c
6
kill.c
@ -228,14 +228,17 @@ extern int kill_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#ifdef BB_KILLALL
|
#ifdef BB_KILLALL
|
||||||
else {
|
else {
|
||||||
|
int all_found = TRUE;
|
||||||
pid_t myPid=getpid();
|
pid_t myPid=getpid();
|
||||||
/* Looks like they want to do a killall. Do that */
|
/* Looks like they want to do a killall. Do that */
|
||||||
while (--argc >= 0) {
|
while (--argc >= 0) {
|
||||||
pid_t* pidList;
|
pid_t* pidList;
|
||||||
|
|
||||||
pidList = findPidByName( *argv);
|
pidList = findPidByName( *argv);
|
||||||
if (!pidList)
|
if (!pidList) {
|
||||||
|
all_found = FALSE;
|
||||||
errorMsg( "%s: no process killed\n", *argv);
|
errorMsg( "%s: no process killed\n", *argv);
|
||||||
|
}
|
||||||
|
|
||||||
for(; pidList && *pidList!=0; pidList++) {
|
for(; pidList && *pidList!=0; pidList++) {
|
||||||
if (*pidList==myPid)
|
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 */
|
* upon exit, so we can save a byte or two */
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
exit (all_found);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -228,14 +228,17 @@ extern int kill_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#ifdef BB_KILLALL
|
#ifdef BB_KILLALL
|
||||||
else {
|
else {
|
||||||
|
int all_found = TRUE;
|
||||||
pid_t myPid=getpid();
|
pid_t myPid=getpid();
|
||||||
/* Looks like they want to do a killall. Do that */
|
/* Looks like they want to do a killall. Do that */
|
||||||
while (--argc >= 0) {
|
while (--argc >= 0) {
|
||||||
pid_t* pidList;
|
pid_t* pidList;
|
||||||
|
|
||||||
pidList = findPidByName( *argv);
|
pidList = findPidByName( *argv);
|
||||||
if (!pidList)
|
if (!pidList) {
|
||||||
|
all_found = FALSE;
|
||||||
errorMsg( "%s: no process killed\n", *argv);
|
errorMsg( "%s: no process killed\n", *argv);
|
||||||
|
}
|
||||||
|
|
||||||
for(; pidList && *pidList!=0; pidList++) {
|
for(; pidList && *pidList!=0; pidList++) {
|
||||||
if (*pidList==myPid)
|
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 */
|
* upon exit, so we can save a byte or two */
|
||||||
argv++;
|
argv++;
|
||||||
}
|
}
|
||||||
|
exit (all_found);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user