1 diff -ru sysvinit-2.85/src/killall5.c sysvinit-2.85-fixed/src/killall5.c
2 --- sysvinit-2.85/src/killall5.c 2003-05-23 00:24:47.000000000 -0400
3 +++ sysvinit-2.85-fixed/src/killall5.c 2003-05-23 00:23:57.000000000 -0400
6 if (p->fullname) free(p->fullname);
7 if (p->pathname) free(p->pathname);
8 + if (p->statname) free(p->statname);
13 /* Open the status file. */
14 snprintf(path, sizeof(path), "/proc/%s/stat", d->d_name);
16 - /* Read SID & statname from it. */
17 + /* Read statname from it. */
18 if ((fp = fopen(path, "r")) != NULL) {
22 /* Read program name. */
23 q = strrchr(buf, ')');
27 "can't get program name from %s\n",
30 while (*q != ' ') q++;
33 - while (*q == ' ') q++;
34 p->statname = (char *)xmalloc(strlen(s)+1);
35 strcpy(p->statname, s);
37 - /* This could be replaced by getsid(pid) */
38 - if (sscanf(q, "%*c %*d %*d %d", &p->sid) != 1) {
40 - nsyslog(LOG_ERR, "can't read sid from %s\n",
47 /* Process disappeared.. */
51 + p->sid = getsid(pid);
54 + nsyslog(LOG_ERR, "can't read sid for pid %d\n", pid);
59 /* Now read argv[0] */
60 snprintf(path, sizeof(path), "/proc/%s/cmdline", d->d_name);
65 - for (p = plist; p; p = p->next)
66 - if (p->pid == pid) {
72 /* Now kill all processes except our session. */
73 for (p = plist; p; p = p->next)