aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Vampl <mobile.leecher@gmail.com>2013-12-16 17:44:58 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-12-16 17:44:58 +0100
commit3ac1e0d753ca8e918a3b97020ae09058efffe057 (patch)
treeb96acd47aa9cfc1184f50669ef9722b1f886e30c
parent9f4f60183b2de12ff618a4966378c6b49184b1de (diff)
downloadbusybox-w32-3ac1e0d753ca8e918a3b97020ae09058efffe057.tar.gz
busybox-w32-3ac1e0d753ca8e918a3b97020ae09058efffe057.tar.bz2
busybox-w32-3ac1e0d753ca8e918a3b97020ae09058efffe057.zip
killall5: return 2 if no processes got killed
function old new delta kill_main 943 992 +49 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/kill.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/procps/kill.c b/procps/kill.c
index cd189bcd6..8e4213730 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -158,7 +158,8 @@ int kill_main(int argc, char **argv)
158 if (killall5) { 158 if (killall5) {
159 pid_t sid; 159 pid_t sid;
160 procps_status_t* p = NULL; 160 procps_status_t* p = NULL;
161 int ret = 0; 161 /* compat: exitcode 2 is "no one was signaled" */
162 int ret = 2;
162 163
163 /* Find out our session id */ 164 /* Find out our session id */
164 sid = getsid(pid); 165 sid = getsid(pid);
@@ -170,6 +171,7 @@ int kill_main(int argc, char **argv)
170 int i; 171 int i;
171 172
172 if (p->sid == (unsigned)sid 173 if (p->sid == (unsigned)sid
174 || p->sid == 0 /* compat: kernel thread, don't signal it */
173 || p->pid == (unsigned)pid 175 || p->pid == (unsigned)pid
174 || p->pid == 1 176 || p->pid == 1
175 ) { 177 ) {
@@ -200,6 +202,7 @@ int kill_main(int argc, char **argv)
200 goto dont_kill; 202 goto dont_kill;
201 } 203 }
202 kill(p->pid, signo); 204 kill(p->pid, signo);
205 ret = 0;
203 dont_kill: ; 206 dont_kill: ;
204 } 207 }
205 resume: 208 resume: