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>
This commit is contained in:
parent
7a4269329f
commit
14850308e9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user