summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorErik Andersen2000-02-23 22:49:58 +0000
committerErik Andersen2000-02-23 22:49:58 +0000
commit5b911ddd577373dfcbd3d2dade7089ff611ea35e (patch)
tree85c5c3dc68f1cece663c3cf1ac960225c980e38c /utility.c
parentdc75a739acefa740f91cf1642f730d5d1a0658ae (diff)
downloadbusybox-5b911ddd577373dfcbd3d2dade7089ff611ea35e.zip
busybox-5b911ddd577373dfcbd3d2dade7089ff611ea35e.tar.gz
Fixed rebooting when init runs as /linuxrc
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utility.c b/utility.c
index 64598fa..0279cca 100644
--- a/utility.c
+++ b/utility.c
@@ -1193,7 +1193,7 @@ extern pid_t findInitPid()
for (init_pid = 1; init_pid < 65536; init_pid++) {
FILE *status;
- sprintf(filename, "/proc/%d/status", init_pid);
+ sprintf(filename, "/proc/%d/cmdline", init_pid);
status = fopen(filename, "r");
if (!status) {
continue;
@@ -1201,7 +1201,7 @@ extern pid_t findInitPid()
fgets(buffer, 256, status);
fclose(status);
- if ((strstr(buffer, "init\n") != NULL)) {
+ if ((strstr(buffer, "init") != NULL)) {
return init_pid;
}
}