summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
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;
}
}