Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 113650 Details for
Bug 138788
[PATCH] pidof bug renders machine unbootable when NFS is stuck
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
new patch
sysvinit-2.85-readlink.patch (text/plain), 2.13 KB, created by
Bill Nottingham
on 2005-04-25 21:29:49 UTC
(
hide
)
Description:
new patch
Filename:
MIME Type:
Creator:
Bill Nottingham
Created:
2005-04-25 21:29:49 UTC
Size:
2.13 KB
patch
obsolete
>--- sysvinit-2.85/src/killall5.c.readlink 2005-04-25 16:11:05.000000000 -0400 >+++ sysvinit-2.85/src/killall5.c 2005-04-25 16:27:48.000000000 -0400 >@@ -50,8 +50,6 @@ > char *fullname; /* Name as found out from argv[0] */ > char *basename; /* Only the part after the last / */ > char *statname; /* the statname without braces */ >- ino_t ino; /* Inode number */ >- dev_t dev; /* Device it is on */ > pid_t pid; /* Process ID. */ > int sid; /* Session ID. */ > struct _proc_ *next; /* Pointer to next struct. */ >@@ -158,7 +156,6 @@ > FILE *fp; > int pid, f; > PROC *p, *n; >- struct stat st; > int c; > > /* Open the /proc directory. */ >@@ -229,6 +226,7 @@ > if (p->sid < 0) { > p->sid = 0; > nsyslog(LOG_ERR, "can't read sid for pid %d\n", pid); >+ free(p->statname); > free(p); > continue; > } >@@ -256,17 +254,17 @@ > p->basename = p->fullname; > } else { > /* Process disappeared.. */ >+ free(p->statname); > free(p); > continue; > } > > /* Try to stat the executable. */ > snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name); >- if (stat(path, &st) == 0) { >- p->dev = st.st_dev; >- p->ino = st.st_ino; >- p->pathname = (char *)xmalloc(PATH_MAX); >- readlink(path, p->pathname, PATH_MAX); >+ >+ p->pathname = (char *)xmalloc(PATH_MAX); >+ if (readlink(path, p->pathname, PATH_MAX) == -1) { >+ p->pathname = NULL; > } > > /* Link it into the list. */ >@@ -329,16 +327,16 @@ > /* Try to get the process ID of a given process. */ > PIDQ *pidof(char *prog) > { >- struct stat st; > int dostat = 0; > PROC *p; > PIDQ *q; > char *s; > int foundone = 0; > int ok = 0; >+ char real_path[PATH_MAX]; > > /* Try to stat the executable. */ >- if (prog[0] == '/' && stat(prog, &st) == 0) dostat++; >+ if (prog[0] == '/' && realpath(prog, real_path)) dostat++; > > /* Get basename of program. */ > if ((s = strrchr(prog, '/')) == NULL) >@@ -352,7 +350,7 @@ > /* First try to find a match based on dev/ino pair. */ > if (dostat) { > for (p = plist; p; p = p->next) { >- if (p->dev == st.st_dev && p->ino == st.st_ino) { >+ if (p->pathname && strcmp(real_path, p->pathname) == 0) { > add_pid_to_q(q, p); > foundone++; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138788
:
106475
|
106478
|
108533
|
108534
|
108535
| 113650