diff options
| -rw-r--r-- | Changelog | 13 | ||||
| -rw-r--r-- | umount.c | 4 | ||||
| -rw-r--r-- | util-linux/umount.c | 4 | ||||
| -rw-r--r-- | utility.c | 4 |
4 files changed, 17 insertions, 8 deletions
| @@ -11,12 +11,13 @@ | |||
| 11 | * Fixed "du" so it gives the same answers as GNU "du" (busybox du used | 11 | * Fixed "du" so it gives the same answers as GNU "du" (busybox du used |
| 12 | to count hard-linked files more then once). Many thanks to | 12 | to count hard-linked files more then once). Many thanks to |
| 13 | Friedrich Vedder <fwv@myrtle.lahn.de> for the fix. | 13 | Friedrich Vedder <fwv@myrtle.lahn.de> for the fix. |
| 14 | * Removed /proc dependancies for init and free (while maintaining exactly | 14 | * Removed /proc dependancies for init and free (while maintaining |
| 15 | the same functionality). /proc takes up 90k of kernel space, so it is | 15 | exactly the same functionality). /proc takes up 90k of kernel |
| 16 | nice to avoid using it at all costs. | 16 | space, so it is nice to avoid using it at all costs. |
| 17 | * init no longer tries to mount /proc (unless there is less the 1 meg free). | 17 | * init no longer tries to mount /proc (unless there is less the 1 meg |
| 18 | Use of /proc (or not) is policy that should be set up in /etc/fstab (or | 18 | free). Use of /proc (or not) is policy that should be set up in |
| 19 | in hardcoded scripts), not in init. | 19 | /etc/fstab (or in hardcoded scripts), not in init. |
| 20 | * Fixed rebooting when init runs as an initrd. | ||
| 20 | 21 | ||
| 21 | -Erik Andersen | 22 | -Erik Andersen |
| 22 | 23 | ||
| @@ -59,9 +59,13 @@ static int doRemount = FALSE; | |||
| 59 | extern const char mtab_file[]; /* Defined in utility.c */ | 59 | extern const char mtab_file[]; /* Defined in utility.c */ |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | |||
| 62 | /* These functions are here because the getmntent functions do not appear | 63 | /* These functions are here because the getmntent functions do not appear |
| 63 | * to be re-entrant, which leads to all sorts of problems when we try to | 64 | * to be re-entrant, which leads to all sorts of problems when we try to |
| 64 | * use them recursively - randolph | 65 | * use them recursively - randolph |
| 66 | * | ||
| 67 | * TODO: Perhaps switch to using Glibc's getmntent_r | ||
| 68 | * -Erik | ||
| 65 | */ | 69 | */ |
| 66 | void mtab_read(void) | 70 | void mtab_read(void) |
| 67 | { | 71 | { |
diff --git a/util-linux/umount.c b/util-linux/umount.c index b58b1a08c..0f087e197 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
| @@ -59,9 +59,13 @@ static int doRemount = FALSE; | |||
| 59 | extern const char mtab_file[]; /* Defined in utility.c */ | 59 | extern const char mtab_file[]; /* Defined in utility.c */ |
| 60 | 60 | ||
| 61 | 61 | ||
| 62 | |||
| 62 | /* These functions are here because the getmntent functions do not appear | 63 | /* These functions are here because the getmntent functions do not appear |
| 63 | * to be re-entrant, which leads to all sorts of problems when we try to | 64 | * to be re-entrant, which leads to all sorts of problems when we try to |
| 64 | * use them recursively - randolph | 65 | * use them recursively - randolph |
| 66 | * | ||
| 67 | * TODO: Perhaps switch to using Glibc's getmntent_r | ||
| 68 | * -Erik | ||
| 65 | */ | 69 | */ |
| 66 | void mtab_read(void) | 70 | void mtab_read(void) |
| 67 | { | 71 | { |
| @@ -1193,7 +1193,7 @@ extern pid_t findInitPid() | |||
| 1193 | for (init_pid = 1; init_pid < 65536; init_pid++) { | 1193 | for (init_pid = 1; init_pid < 65536; init_pid++) { |
| 1194 | FILE *status; | 1194 | FILE *status; |
| 1195 | 1195 | ||
| 1196 | sprintf(filename, "/proc/%d/status", init_pid); | 1196 | sprintf(filename, "/proc/%d/cmdline", init_pid); |
| 1197 | status = fopen(filename, "r"); | 1197 | status = fopen(filename, "r"); |
| 1198 | if (!status) { | 1198 | if (!status) { |
| 1199 | continue; | 1199 | continue; |
| @@ -1201,7 +1201,7 @@ extern pid_t findInitPid() | |||
| 1201 | fgets(buffer, 256, status); | 1201 | fgets(buffer, 256, status); |
| 1202 | fclose(status); | 1202 | fclose(status); |
| 1203 | 1203 | ||
| 1204 | if ((strstr(buffer, "init\n") != NULL)) { | 1204 | if ((strstr(buffer, "init") != NULL)) { |
| 1205 | return init_pid; | 1205 | return init_pid; |
| 1206 | } | 1206 | } |
| 1207 | } | 1207 | } |
