Fixed rebooting when init runs as /linuxrc
authorErik Andersen <andersen@codepoet.org>
Wed, 23 Feb 2000 22:49:58 +0000 (22:49 -0000)
committerErik Andersen <andersen@codepoet.org>
Wed, 23 Feb 2000 22:49:58 +0000 (22:49 -0000)
 -Erik

Changelog
umount.c
util-linux/umount.c
utility.c

index 2465d2c76e7b689120169379602d58ba4707b4dd..3c90ab97fd5298f84547f901f666c218d2d81112 100644 (file)
--- a/Changelog
+++ b/Changelog
        * Fixed "du" so it gives the same answers as GNU "du" (busybox du used 
            to count hard-linked files more then once).  Many thanks to 
            Friedrich Vedder <fwv@myrtle.lahn.de> for the fix.
-       * Removed /proc dependancies for init and free (while maintaining exactly
-           the same functionality).  /proc takes up 90k of kernel space, so it is
-           nice to avoid using it at all costs.
-       * init no longer tries to mount /proc (unless there is less the 1 meg free).  
-           Use of /proc (or not) is policy that should be set up in /etc/fstab (or
-           in hardcoded scripts), not in init.
+       * Removed /proc dependancies for init and free (while maintaining 
+           exactly the same functionality).  /proc takes up 90k of kernel 
+           space, so it is nice to avoid using it at all costs.
+       * init no longer tries to mount /proc (unless there is less the 1 meg 
+           free).  Use of /proc (or not) is policy that should be set up in 
+           /etc/fstab (or in hardcoded scripts), not in init.
+       * Fixed rebooting when init runs as an initrd.
 
        -Erik Andersen
 
index b58b1a08c5bb19038682a94304da41883d2c91f1..0f087e197e8ae0b9cf320a220f27841d07460943 100644 (file)
--- a/umount.c
+++ b/umount.c
@@ -59,9 +59,13 @@ static int doRemount = FALSE;
 extern const char mtab_file[]; /* Defined in utility.c */
 
 
+
 /* These functions are here because the getmntent functions do not appear
  * to be re-entrant, which leads to all sorts of problems when we try to
  * use them recursively - randolph
+ *
+ * TODO: Perhaps switch to using Glibc's getmntent_r
+ *        -Erik
  */
 void mtab_read(void)
 {
index b58b1a08c5bb19038682a94304da41883d2c91f1..0f087e197e8ae0b9cf320a220f27841d07460943 100644 (file)
@@ -59,9 +59,13 @@ static int doRemount = FALSE;
 extern const char mtab_file[]; /* Defined in utility.c */
 
 
+
 /* These functions are here because the getmntent functions do not appear
  * to be re-entrant, which leads to all sorts of problems when we try to
  * use them recursively - randolph
+ *
+ * TODO: Perhaps switch to using Glibc's getmntent_r
+ *        -Erik
  */
 void mtab_read(void)
 {
index 64598fab6a6a965db206cbac167075b01ed61a1f..0279cca566e3c8c553424cf12b7fb49421f517d6 100644 (file)
--- 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;
                }
        }