]> git.pld-linux.org Git - packages/SysVinit.git/blob - sysvinit-pidof.patch
- does not require logrotate; rel 19
[packages/SysVinit.git] / sysvinit-pidof.patch
1 --- sysvinit-2.86/src/killall5.c.orig   2004-07-30 14:16:23.000000000 +0200
2 +++ sysvinit-2.86/src/killall5.c        2004-12-26 23:05:17.284315424 +0100
3 @@ -47,8 +47,9 @@
4  
5  /* Info about a process. */
6  typedef struct proc {
7 +       char *pathname;         /* full path to executable        */
8         char *argv0;            /* Name as found out from argv[0] */
9 -       char *argv0base;        /* `basename argv[1]`             */
10 +       char *argv0base;        /* `basename argv[0]`             */
11         char *argv1;            /* Name as found out from argv[1] */
12         char *argv1base;        /* `basename argv[1]`             */
13         char *statname;         /* the statname without braces    */
14 @@ -191,6 +192,7 @@
15                 n = p->next;
16                 if (p->argv0) free(p->argv0);
17                 if (p->argv1) free(p->argv1);
18 +               if (p->pathname) free(p->pathname);
19                 free(p);
20         }
21         plist = NULL;
22 @@ -309,6 +311,8 @@
23                 if (stat(path, &st) == 0) {
24                         p->dev = st.st_dev;
25                         p->ino = st.st_ino;
26 +                       p->pathname = (char *)xmalloc(PATH_MAX);
27 +                       readlink(path, p->pathname, PATH_MAX);
28                 }
29  
30                 /* Link it into the list. */
31 @@ -425,6 +429,10 @@
32                      strchr(p->argv0, ' '))) {
33                         ok += (strcmp(p->statname, s) == 0);
34                 }
35 +                       
36 +               if (prog[0] == '/' && p->pathname && strcmp(prog, p->pathname))
37 +                       ok = 0;
38 +
39                 if (ok) add_pid_to_q(q, p);
40         }
41  
This page took 0.071712 seconds and 3 git commands to generate.