소스 검색

If in --test mode, and --stop is given, increment n_killed, so that
start-stop-daemon returns the proper exit value. Thanks Thomas Morin
<thomas.morin@enst-bretagne.fr>.

Adam Heath 24 년 전
부모
커밋
a5d94db30a
3개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. 6 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 3 2
      utils/start-stop-daemon.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Thu Jul 11 22:26:30 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * 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 <thomas.morin@enst-bretagne.fr>.
+
 Thu Jul 11 22:19:12 CDT 2002 Adam Heath <doogie@debian.org>
 
   * utils/start-stop-daemon.c: Fix test inversion in start-stop-daemon,

+ 3 - 0
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 <thomas.morin@enst-bretagne.fr>.
     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
+    <thomas.morin@enst-bretagne.fr>.  Closes: #151992.
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 3 - 2
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 {