diff options
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1068,7 +1068,12 @@ extern long getNum (const char *cp) | |||
1068 | } | 1068 | } |
1069 | #endif | 1069 | #endif |
1070 | 1070 | ||
1071 | #if 1 | 1071 | |
1072 | #if defined BB_INIT || defined BB_HALT || defined BB_REBOOT | ||
1073 | |||
1074 | #if ! defined BB_FEATURE_USE_PROCFS | ||
1075 | #error Sorry, I depend on the /proc filesystem right now. | ||
1076 | #endif | ||
1072 | /* findInitPid() | 1077 | /* findInitPid() |
1073 | * | 1078 | * |
1074 | * This finds the pid of init (which is not always 1). | 1079 | * This finds the pid of init (which is not always 1). |
@@ -1095,7 +1100,7 @@ findInitPid() | |||
1095 | fgets(buffer, 256, status); | 1100 | fgets(buffer, 256, status); |
1096 | fclose(status); | 1101 | fclose(status); |
1097 | 1102 | ||
1098 | if ( (strcmp(&buffer[6], "init\n") == 0)) { | 1103 | if ( (strstr(buffer, "init\n") != NULL )) { |
1099 | return init_pid; | 1104 | return init_pid; |
1100 | } | 1105 | } |
1101 | } | 1106 | } |