projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a3e01d
)
start-stop-daemon: fix "-K --test --pidfile PIDFILE" exitcode
author
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 4 Apr 2011 00:03:35 +0000
(
02:03
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Mon, 4 Apr 2011 00:03:35 +0000
(
02:03
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
debianutils/start_stop_daemon.c
patch
|
blob
|
history
diff --git
a/debianutils/start_stop_daemon.c
b/debianutils/start_stop_daemon.c
index 30dd9709d57aef5cd685d315e2c610d442bfc7e8..bc61959d28c736de8737647c006826360c662886 100644
(file)
--- a/
debianutils/start_stop_daemon.c
+++ b/
debianutils/start_stop_daemon.c
@@
-337,11
+337,17
@@
static int do_stop(void)
goto ret;
}
for (p = G.found_procs; p; p = p->next) {
- if (
TEST || kill(p->pid,
signal_nr) == 0) {
+ if (
kill(p->pid, TEST ? 0 :
signal_nr) == 0) {
killed++;
} else {
- p->pid = 0;
bb_perror_msg("warning: killing process %u", (unsigned)p->pid);
+ p->pid = 0;
+ if (TEST) {
+ /* Example: -K --test --pidfile PIDFILE detected
+ * that PIDFILE's pid doesn't exist */
+ killed = -1;
+ goto ret;
+ }
}
}
if (!QUIET && killed) {