]> git.pld-linux.org Git - packages/SysVinit.git/blame - sysvinit-pidof.patch
- quote CC
[packages/SysVinit.git] / sysvinit-pidof.patch
CommitLineData
437bcd41
AM
1--- sysvinit-2.84/src/killall5.c.foo 2002-07-18 21:48:55.000000000 -0400
2+++ sysvinit-2.84/src/killall5.c 2002-07-18 22:00:14.000000000 -0400
3@@ -45,6 +45,7 @@
4 /* Info about a process. */
5 typedef struct _proc_
6 {
7+ char *pathname; /* full path to executable */
8 char *fullname; /* Name as found out from argv[0] */
9 char *basename; /* Only the part after the last / */
10 char *statname; /* the statname without braces */
11@@ -165,6 +166,7 @@
12 for (p = plist; n; p = n) {
13 n = p->next;
14 if (p->fullname) free(p->fullname);
15+ if (p->pathname) free(p->pathname);
16 free(p);
17 }
18 plist = NULL;
19@@ -256,6 +258,8 @@
20 if (stat(path, &st) == 0) {
21 p->dev = st.st_dev;
22 p->ino = st.st_ino;
23+ p->pathname = (char *)xmalloc(PATH_MAX);
24+ readlink(path, p->pathname, PATH_MAX);
25 }
26
27 /* Link it into the list. */
28@@ -360,6 +364,9 @@
29 strchr(p->fullname, ' ') ||
30 scripts_too)
31 ok += (strcmp(p->statname, s) == 0);
32+
33+ if (prog[0] == '/' && p->pathname && strcmp(prog,p->pathname))
34+ ok = 0;
35
36 if (ok) add_pid_to_q(q, p);
37 }
This page took 0.023334 seconds and 4 git commands to generate.