← Commit list

929f63e57

Denys Vlasenko
Denys Vlasenko
2011-04-04
FAILED Duration: 208s

Subject

start-stop-daemon: fix "-K --test --pidfile PIDFILE" exitcode

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

debianutils/start_stop_daemon.c+8 -2
@@ -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) {