aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-04-03 08:16:05 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2012-04-03 08:16:05 +0200
commit14850308e902594785e6789a4f28677103ca2096 (patch)
tree42a530404d2601a3f941b37fbb6ab6c2557086d9
parent7a4269329fa05411b477b540beebf18af90e9b42 (diff)
downloadbusybox-w32-14850308e902594785e6789a4f28677103ca2096.tar.gz
busybox-w32-14850308e902594785e6789a4f28677103ca2096.tar.bz2
busybox-w32-14850308e902594785e6789a4f28677103ca2096.zip
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>
-rw-r--r--procps/kill.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/procps/kill.c b/procps/kill.c
index b267a7aaf..cd189bcd6 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -163,7 +163,8 @@ int kill_main(int argc, char **argv)
163 /* Find out our session id */ 163 /* Find out our session id */
164 sid = getsid(pid); 164 sid = getsid(pid);
165 /* Stop all processes */ 165 /* Stop all processes */
166 kill(-1, SIGSTOP); 166 if (signo != SIGSTOP && signo != SIGCONT)
167 kill(-1, SIGSTOP);
167 /* Signal all processes except those in our session */ 168 /* Signal all processes except those in our session */
168 while ((p = procps_scan(p, PSSCAN_PID|PSSCAN_SID)) != NULL) { 169 while ((p = procps_scan(p, PSSCAN_PID|PSSCAN_SID)) != NULL) {
169 int i; 170 int i;
@@ -203,7 +204,8 @@ int kill_main(int argc, char **argv)
203 } 204 }
204 resume: 205 resume:
205 /* And let them continue */ 206 /* And let them continue */
206 kill(-1, SIGCONT); 207 if (signo != SIGSTOP && signo != SIGCONT)
208 kill(-1, SIGCONT);
207 return ret; 209 return ret;
208 } 210 }
209 211