summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch')
-rw-r--r--meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch38
1 files changed, 19 insertions, 19 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch b/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch
index 494aa0e012..8ef292ed12 100644
--- a/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch
+++ b/meta/recipes-core/sysvinit/sysvinit/pidof-add-m-option.patch
@@ -1,4 +1,4 @@
1From 6c490ea6579a132fabb7dbd25387bb521f820371 Mon Sep 17 00:00:00 2001 1From 0e441712d0e366a0384ff3fa879f5a2d2607c24f Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 24 Jul 2013 17:07:22 +0800 3Date: Wed, 24 Jul 2013 17:07:22 +0800
4Subject: [PATCH] pidof: add -m option 4Subject: [PATCH] pidof: add -m option
@@ -10,7 +10,7 @@ each other's pids.
10 10
11https://bugzilla.redhat.com/show_bug.cgi?id=883856 11https://bugzilla.redhat.com/show_bug.cgi?id=883856
12 12
13Upstream-Status: backport 13Upstream-Status: Backport
14Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166 14Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166
15 15
16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
@@ -21,10 +21,10 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
21 2 files changed, 65 insertions(+), 3 deletions(-) 21 2 files changed, 65 insertions(+), 3 deletions(-)
22 22
23diff --git a/man/pidof.8 b/man/pidof.8 23diff --git a/man/pidof.8 b/man/pidof.8
24index ebe5f55..2fdc4d3 100644 24index 6866cb3..a87d878 100644
25--- a/man/pidof.8 25--- a/man/pidof.8
26+++ b/man/pidof.8 26+++ b/man/pidof.8
27@@ -25,6 +25,7 @@ pidof -- find the process ID of a running program. 27@@ -25,6 +25,7 @@ pidof - find the process ID of a running program
28 .RB [ \-n ] 28 .RB [ \-n ]
29 .RB [ \-x ] 29 .RB [ \-x ]
30 .RB [ \-z ] 30 .RB [ \-z ]
@@ -32,9 +32,9 @@ index ebe5f55..2fdc4d3 100644
32 .RB [ \-o 32 .RB [ \-o
33 .IR omitpid[,omitpid...] ] 33 .IR omitpid[,omitpid...] ]
34 .RB [ \-o 34 .RB [ \-o
35@@ -76,6 +77,11 @@ is shown. The default separator is a space. 35@@ -77,6 +78,11 @@ is shown. The default separator is a space.
36 Tells \fIpidof\fP to omit processes with that process id. The special 36 Tells \fIpidof\fP to omit processes with that process id. The special
37 pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP 37 pid \fB%PPID\fP can be used to name the parent process of the \fBpidof\fP
38 program, in other words the calling shell or shell script. 38 program, in other words the calling shell or shell script.
39+.IP -m 39+.IP -m
40+When used with -o, will also omit any processes that have the same 40+When used with -o, will also omit any processes that have the same
@@ -45,10 +45,10 @@ index ebe5f55..2fdc4d3 100644
45 .TP 45 .TP
46 .B 0 46 .B 0
47diff --git a/src/killall5.c b/src/killall5.c 47diff --git a/src/killall5.c b/src/killall5.c
48index 8b5cb38..a664954 100644 48index b0728fa..72289e3 100644
49--- a/src/killall5.c 49--- a/src/killall5.c
50+++ b/src/killall5.c 50+++ b/src/killall5.c
51@@ -126,6 +126,7 @@ typedef struct _s_nfs 51@@ -121,6 +121,7 @@ typedef struct _s_nfs
52 52
53 /* List of processes. */ 53 /* List of processes. */
54 PROC *plist; 54 PROC *plist;
@@ -56,7 +56,7 @@ index 8b5cb38..a664954 100644
56 56
57 /* List of processes to omit. */ 57 /* List of processes to omit. */
58 OMIT *omit; 58 OMIT *omit;
59@@ -361,6 +362,20 @@ static void clear_mnt(void) 59@@ -356,6 +357,20 @@ static void clear_mnt(void)
60 } 60 }
61 } 61 }
62 62
@@ -77,15 +77,15 @@ index 8b5cb38..a664954 100644
77 /* 77 /*
78 * Check if path is a shadow off a NFS partition. 78 * Check if path is a shadow off a NFS partition.
79 */ 79 */
80@@ -486,6 +501,7 @@ int readproc(int do_stat) 80@@ -481,6 +496,7 @@ int readproc()
81 DIR *dir; 81 DIR *dir;
82 FILE *fp; 82 FILE *fp;
83 PROC *p, *n; 83 PROC *p, *n;
84+ OMIT *o, *m; 84+ OMIT *o, *m;
85 struct dirent *d; 85 struct dirent *d;
86 struct stat st;
87 char path[PATH_MAX+1]; 86 char path[PATH_MAX+1];
88@@ -733,6 +749,17 @@ int readproc(int do_stat) 87 char buf[PATH_MAX+1];
88@@ -670,6 +686,17 @@ int readproc()
89 p->next = plist; 89 p->next = plist;
90 plist = p; 90 plist = p;
91 p->pid = pid; 91 p->pid = pid;
@@ -103,7 +103,7 @@ index 8b5cb38..a664954 100644
103 } 103 }
104 closedir(dir); 104 closedir(dir);
105 105
106@@ -944,6 +971,26 @@ PIDQ_HEAD *pidof(char *prog) 106@@ -870,6 +897,26 @@ PIDQ_HEAD *pidof(char *prog)
107 return q; 107 return q;
108 } 108 }
109 109
@@ -130,7 +130,7 @@ index 8b5cb38..a664954 100644
130 /* Give usage message and exit. */ 130 /* Give usage message and exit. */
131 void usage(void) 131 void usage(void)
132 { 132 {
133@@ -994,6 +1041,7 @@ void nsyslog(int pri, char *fmt, ...) 133@@ -920,6 +967,7 @@ void nsyslog(int pri, char *fmt, ...)
134 #define PIDOF_OMIT 0x02 134 #define PIDOF_OMIT 0x02
135 #define PIDOF_NETFS 0x04 135 #define PIDOF_NETFS 0x04
136 #define PIDOF_QUIET 0x08 136 #define PIDOF_QUIET 0x08
@@ -138,7 +138,7 @@ index 8b5cb38..a664954 100644
138 138
139 /* 139 /*
140 * Pidof functionality. 140 * Pidof functionality.
141@@ -1011,6 +1059,7 @@ int main_pidof(int argc, char **argv) 141@@ -937,6 +985,7 @@ int main_pidof(int argc, char **argv)
142 char tmp[512]; 142 char tmp[512];
143 char sep = ' '; 143 char sep = ' ';
144 144
@@ -146,7 +146,7 @@ index 8b5cb38..a664954 100644
146 omit = (OMIT*)0; 146 omit = (OMIT*)0;
147 nlist = (NFS*)0; 147 nlist = (NFS*)0;
148 opterr = 0; 148 opterr = 0;
149@@ -1018,7 +1067,7 @@ int main_pidof(int argc, char **argv) 149@@ -944,7 +993,7 @@ int main_pidof(int argc, char **argv)
150 if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0)) 150 if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
151 flags |= PIDOF_NETFS; 151 flags |= PIDOF_NETFS;
152 152
@@ -155,7 +155,7 @@ index 8b5cb38..a664954 100644
155 case '?': 155 case '?':
156 nsyslog(LOG_ERR,"invalid options on command line!\n"); 156 nsyslog(LOG_ERR,"invalid options on command line!\n");
157 closelog(); 157 closelog();
158@@ -1069,6 +1118,9 @@ int main_pidof(int argc, char **argv) 158@@ -995,6 +1044,9 @@ int main_pidof(int argc, char **argv)
159 case 'z': 159 case 'z':
160 list_dz_processes = TRUE; 160 list_dz_processes = TRUE;
161 break; 161 break;
@@ -165,7 +165,7 @@ index 8b5cb38..a664954 100644
165 case 'n': 165 case 'n':
166 flags |= PIDOF_NETFS; 166 flags |= PIDOF_NETFS;
167 break; 167 break;
168@@ -1100,10 +1152,13 @@ int main_pidof(int argc, char **argv) 168@@ -1026,10 +1078,13 @@ int main_pidof(int argc, char **argv)
169 pid_t spid = 0; 169 pid_t spid = 0;
170 while ((p = get_next_from_pid_q(q))) { 170 while ((p = get_next_from_pid_q(q))) {
171 if ((flags & PIDOF_OMIT) && omit) { 171 if ((flags & PIDOF_OMIT) && omit) {
@@ -181,7 +181,7 @@ index 8b5cb38..a664954 100644
181 } 181 }
182 182
183 /* 183 /*
184@@ -1145,6 +1200,7 @@ int main_pidof(int argc, char **argv) 184@@ -1071,6 +1126,7 @@ int main_pidof(int argc, char **argv)
185 printf("\n"); 185 printf("\n");
186 } 186 }
187 187