aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-02-23 22:49:58 +0000
committerErik Andersen <andersen@codepoet.org>2000-02-23 22:49:58 +0000
commit5b911ddd577373dfcbd3d2dade7089ff611ea35e (patch)
tree85c5c3dc68f1cece663c3cf1ac960225c980e38c
parentdc75a739acefa740f91cf1642f730d5d1a0658ae (diff)
downloadbusybox-w32-5b911ddd577373dfcbd3d2dade7089ff611ea35e.tar.gz
busybox-w32-5b911ddd577373dfcbd3d2dade7089ff611ea35e.tar.bz2
busybox-w32-5b911ddd577373dfcbd3d2dade7089ff611ea35e.zip
Fixed rebooting when init runs as /linuxrc
-Erik
-rw-r--r--Changelog13
-rw-r--r--umount.c4
-rw-r--r--util-linux/umount.c4
-rw-r--r--utility.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/Changelog b/Changelog
index 2465d2c76..3c90ab97f 100644
--- a/Changelog
+++ b/Changelog
@@ -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
diff --git a/umount.c b/umount.c
index b58b1a08c..0f087e197 100644
--- a/umount.c
+++ b/umount.c
@@ -59,9 +59,13 @@ static int doRemount = FALSE;
59extern const char mtab_file[]; /* Defined in utility.c */ 59extern 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 */
66void mtab_read(void) 70void 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;
59extern const char mtab_file[]; /* Defined in utility.c */ 59extern 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 */
66void mtab_read(void) 70void mtab_read(void)
67{ 71{
diff --git a/utility.c b/utility.c
index 64598fab6..0279cca56 100644
--- a/utility.c
+++ b/utility.c
@@ -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 }