[Pkg-sysvinit-commits] r1062 - in sysvinit/trunk/debian: . patches

pere at alioth.debian.org pere at alioth.debian.org
Sun Nov 18 22:54:20 UTC 2007


Author: pere
Date: 2007-11-18 22:54:20 +0000 (Sun, 18 Nov 2007)
New Revision: 1062

Added:
   sysvinit/trunk/debian/patches/80_killall_pidof.dpatch
Removed:
   sysvinit/trunk/debian/patches/20_pidof.dpatch
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/patches/00list
Log:
  * Rename 20_pidof.dpatch to 80_killall_pidof.dpatch, to group the
    killall5 patches together.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2007-11-18 21:36:19 UTC (rev 1061)
+++ sysvinit/trunk/debian/changelog	2007-11-18 22:54:20 UTC (rev 1062)
@@ -7,6 +7,8 @@
   * Acknowledge NMU. (Closes: #433386)
   * Make /lib/init/vars.sh usable when 'set -e' is in effect.  Patch
     from Ubuntu.
+  * Rename 20_pidof.dpatch to 80_killall_pidof.dpatch, to group the
+    killall5 patches together.
 
  -- Petter Reinholdtsen <pere at debian.org>  Tue, 30 Jan 2007 23:14:04 +0100
 

Modified: sysvinit/trunk/debian/patches/00list
===================================================================
--- sysvinit/trunk/debian/patches/00list	2007-11-18 21:36:19 UTC (rev 1061)
+++ sysvinit/trunk/debian/patches/00list	2007-11-18 22:54:20 UTC (rev 1062)
@@ -6,7 +6,6 @@
 14_doc_fsf_addr
 15_doc_pidof
 16_doc_runlevel
-20_pidof
 21_ifdown_kfreebsd
 25_last_sanify
 30_strip
@@ -28,6 +27,7 @@
 #68_init_quiet
 70_wall_ttyname
 71_wall_hostname
+80_killall_pidof
 80_killall_sched
 81_killall_avoid_init
 82_killall_retval

Deleted: sysvinit/trunk/debian/patches/20_pidof.dpatch
===================================================================
--- sysvinit/trunk/debian/patches/20_pidof.dpatch	2007-11-18 21:36:19 UTC (rev 1061)
+++ sysvinit/trunk/debian/patches/20_pidof.dpatch	2007-11-18 22:54:20 UTC (rev 1062)
@@ -1,99 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 20_pidof.dpatch by Petter Reinholdtsen
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Modify pidof to not print empty line if no pid was found. (bug: #225476)
-
- at DPATCH@
---- sysvinit-2.86.ds1.orig/src/killall5.c
-+++ sysvinit-2.86.ds1/src/killall5.c
-@@ -378,8 +391,8 @@
- 	int		foundone = 0;
- 	int		ok = 0;
- 
--	/* Try to stat the executable. */
--	if (prog[0] == '/' && stat(prog, &st) == 0) dostat++;
-+	if (! prog)
-+		return NULL;
- 
- 	/* Get basename of program. */
- 	if ((s = strrchr(prog, '/')) == NULL)
-@@ -387,9 +400,16 @@
- 	else
- 		s++;
- 
-+	if (! *s)
-+		return NULL;
-+
- 	q = (PIDQ_HEAD *)xmalloc(sizeof(PIDQ_HEAD));
- 	q = init_pid_q(q);
- 
-+	/* Try to stat the executable. */
-+	if (prog[0] == '/' && stat(prog, &st) == 0)
-+		dostat++;
-+
- 	/* First try to find a match based on dev/ino pair. */
- 	if (dostat) {
- 		for (p = plist; p; p = p->next) {
-@@ -404,15 +424,35 @@
- 	if (!foundone) for (p = plist; p; p = p->next) {
- 		ok = 0;
- 
--		/* Compare name (both basename and full path) */
--		ok += (p->argv0 && strcmp(p->argv0, prog) == 0);
--		ok += (p->argv0 && strcmp(p->argv0base, s) == 0);
-+		/*             matching        nonmatching
-+		 * proc name   prog name       prog name
-+		 * ---         -----------     ------------
-+		 *   b         b, p/b, q/b
-+		 * p/b         b, p/b          q/b
-+		 *
-+		 * Algorithm: Match if:
-+		 *    cmd = arg
-+		 * or cmd = base(arg)
-+		 * or base(cmd) = arg
-+		 *
-+		 * Specifically, do not match just because base(cmd) = base(arg)
-+		 * as was done in earlier versions of this program, since this
-+		 * allows /aaa/foo to match /bbb/foo .
-+		 */
-+		ok |=
-+			(p->argv0 && strcmp(p->argv0, prog) == 0)
-+			|| (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
-+			|| (p->argv0base && strcmp(p->argv0base, prog) == 0);
- 
- 		/* For scripts, compare argv[1] as well. */
--		if (scripts_too && p->argv1 &&
--		    !strncmp(p->statname, p->argv1base, STATNAMELEN)) {
--			ok += (strcmp(p->argv1, prog) == 0);
--			ok += (strcmp(p->argv1base, s) == 0);
-+		if (
-+			scripts_too && p->statname && p->argv1base
-+			&& !strncmp(p->statname, p->argv1base, STATNAMELEN)
-+		) {
-+			ok |=
-+				(p->argv1 && strcmp(p->argv1, prog) == 0)
-+				|| (p->argv1 && s != prog && strcmp(p->argv1, s) == 0)
-+				|| (p->argv1base && strcmp(p->argv1base, prog) == 0);
- 		}
- 
- 		/*
-@@ -423,7 +463,7 @@
- 		    (p->argv0 == NULL ||
- 		     p->argv0[0] == 0 ||
- 		     strchr(p->argv0, ' '))) {
--			ok += (strcmp(p->statname, s) == 0);
-+			ok |= (strcmp(p->statname, s) == 0);
- 		}
- 		if (ok) add_pid_to_q(q, p);
- 	}
-@@ -548,7 +588,8 @@
- 			}
- 		}
- 	}
--	printf("\n");
-+	if (!first)
-+		printf("\n");
- 	closelog();
- 	return(first ? 1 : 0);
- }

Copied: sysvinit/trunk/debian/patches/80_killall_pidof.dpatch (from rev 1061, sysvinit/trunk/debian/patches/20_pidof.dpatch)
===================================================================
--- sysvinit/trunk/debian/patches/80_killall_pidof.dpatch	                        (rev 0)
+++ sysvinit/trunk/debian/patches/80_killall_pidof.dpatch	2007-11-18 22:54:20 UTC (rev 1062)
@@ -0,0 +1,99 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_pidof.dpatch by Petter Reinholdtsen
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Modify pidof to not print empty line if no pid was found. (bug: #225476)
+
+ at DPATCH@
+--- sysvinit-2.86.ds1.orig/src/killall5.c
++++ sysvinit-2.86.ds1/src/killall5.c
+@@ -378,8 +391,8 @@
+ 	int		foundone = 0;
+ 	int		ok = 0;
+ 
+-	/* Try to stat the executable. */
+-	if (prog[0] == '/' && stat(prog, &st) == 0) dostat++;
++	if (! prog)
++		return NULL;
+ 
+ 	/* Get basename of program. */
+ 	if ((s = strrchr(prog, '/')) == NULL)
+@@ -387,9 +400,16 @@
+ 	else
+ 		s++;
+ 
++	if (! *s)
++		return NULL;
++
+ 	q = (PIDQ_HEAD *)xmalloc(sizeof(PIDQ_HEAD));
+ 	q = init_pid_q(q);
+ 
++	/* Try to stat the executable. */
++	if (prog[0] == '/' && stat(prog, &st) == 0)
++		dostat++;
++
+ 	/* First try to find a match based on dev/ino pair. */
+ 	if (dostat) {
+ 		for (p = plist; p; p = p->next) {
+@@ -404,15 +424,35 @@
+ 	if (!foundone) for (p = plist; p; p = p->next) {
+ 		ok = 0;
+ 
+-		/* Compare name (both basename and full path) */
+-		ok += (p->argv0 && strcmp(p->argv0, prog) == 0);
+-		ok += (p->argv0 && strcmp(p->argv0base, s) == 0);
++		/*             matching        nonmatching
++		 * proc name   prog name       prog name
++		 * ---         -----------     ------------
++		 *   b         b, p/b, q/b
++		 * p/b         b, p/b          q/b
++		 *
++		 * Algorithm: Match if:
++		 *    cmd = arg
++		 * or cmd = base(arg)
++		 * or base(cmd) = arg
++		 *
++		 * Specifically, do not match just because base(cmd) = base(arg)
++		 * as was done in earlier versions of this program, since this
++		 * allows /aaa/foo to match /bbb/foo .
++		 */
++		ok |=
++			(p->argv0 && strcmp(p->argv0, prog) == 0)
++			|| (p->argv0 && s != prog && strcmp(p->argv0, s) == 0)
++			|| (p->argv0base && strcmp(p->argv0base, prog) == 0);
+ 
+ 		/* For scripts, compare argv[1] as well. */
+-		if (scripts_too && p->argv1 &&
+-		    !strncmp(p->statname, p->argv1base, STATNAMELEN)) {
+-			ok += (strcmp(p->argv1, prog) == 0);
+-			ok += (strcmp(p->argv1base, s) == 0);
++		if (
++			scripts_too && p->statname && p->argv1base
++			&& !strncmp(p->statname, p->argv1base, STATNAMELEN)
++		) {
++			ok |=
++				(p->argv1 && strcmp(p->argv1, prog) == 0)
++				|| (p->argv1 && s != prog && strcmp(p->argv1, s) == 0)
++				|| (p->argv1base && strcmp(p->argv1base, prog) == 0);
+ 		}
+ 
+ 		/*
+@@ -423,7 +463,7 @@
+ 		    (p->argv0 == NULL ||
+ 		     p->argv0[0] == 0 ||
+ 		     strchr(p->argv0, ' '))) {
+-			ok += (strcmp(p->statname, s) == 0);
++			ok |= (strcmp(p->statname, s) == 0);
+ 		}
+ 		if (ok) add_pid_to_q(q, p);
+ 	}
+@@ -548,7 +588,8 @@
+ 			}
+ 		}
+ 	}
+-	printf("\n");
++	if (!first)
++		printf("\n");
+ 	closelog();
+ 	return(first ? 1 : 0);
+ }




More information about the Pkg-sysvinit-commits mailing list