summaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenys Vlasenko2012-04-03 08:16:05 +0200
committerDenys Vlasenko2012-04-03 08:16:05 +0200
commit14850308e902594785e6789a4f28677103ca2096 (patch)
tree42a530404d2601a3f941b37fbb6ab6c2557086d9 /procps
parent7a4269329fa05411b477b540beebf18af90e9b42 (diff)
downloadbusybox-14850308e902594785e6789a4f28677103ca2096.zip
busybox-14850308e902594785e6789a4f28677103ca2096.tar.gz
killall5: don't do STOP/CONT dance if the signal we send is SIGSTOP or SIGCONT
function old new delta kill_main 913 942 +29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r--procps/kill.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/procps/kill.c b/procps/kill.c
index b267a7a..cd189bc 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -163,7 +163,8 @@ int kill_main(int argc, char **argv)
/* Find out our session id */
sid = getsid(pid);
/* Stop all processes */
- kill(-1, SIGSTOP);
+ if (signo != SIGSTOP && signo != SIGCONT)
+ kill(-1, SIGSTOP);
/* Signal all processes except those in our session */
while ((p = procps_scan(p, PSSCAN_PID|PSSCAN_SID)) != NULL) {
int i;
@@ -203,7 +204,8 @@ int kill_main(int argc, char **argv)
}
resume:
/* And let them continue */
- kill(-1, SIGCONT);
+ if (signo != SIGSTOP && signo != SIGCONT)
+ kill(-1, SIGCONT);
return ret;
}