From: Adam Heath Date: Fri, 12 Jul 2002 03:32:00 +0000 (+0000) Subject: If in --test mode, and --stop is given, increment n_killed, so that X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5d94db30a64d2c9d886bf0ac178ed603de5f8d3;p=dpkg If in --test mode, and --stop is given, increment n_killed, so that start-stop-daemon returns the proper exit value. Thanks Thomas Morin . --- diff --git a/ChangeLog b/ChangeLog index b1230ca7..49f69283 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jul 11 22:26:30 CDT 2002 Adam Heath + + * utils/start-stop-daemon.c: If in --test mode, and --stop is given, + increment n_killed, so that start-stop-daemon returns the proper exit + value. Thanks Thomas Morin . + Thu Jul 11 22:19:12 CDT 2002 Adam Heath * utils/start-stop-daemon.c: Fix test inversion in start-stop-daemon, diff --git a/debian/changelog b/debian/changelog index d31340e3..a987f60e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ dpkg (1.10.3) unstable; urgency=low * Fix test inversion in start-stop-daemon, when checking the pid given in a pid file. Thanks Thomas Morin . Closes: #152270. + * If in --test mode, and --stop is given, increment n_killed, so that + start-stop-daemon returns the proper exit value. Thanks Thomas Morin + . Closes: #151992. -- Wichert Akkerman UNRELEASED diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 654ab76a..9275463a 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -941,10 +941,11 @@ do_stop(int signal_nr, int quietmode, int *n_killed, int *n_notkilled, int retry clear(&killed); for (p = found; p; p = p->next) { - if (testmode) + if (testmode) { printf("Would send signal %d to %d.\n", signal_nr, p->pid); - else if (kill(p->pid, signal_nr) == 0) { + (*n_killed)++; + } else if (kill(p->pid, signal_nr) == 0) { push(&killed, p->pid); (*n_killed)++; } else {