aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-11-05 04:23:05 +0000
committerEric Andersen <andersen@codepoet.org>1999-11-05 04:23:05 +0000
commite18c75a563cf202a24effa8a4631dbf46bcc1575 (patch)
treedafe859ecf0224a7f7c6ce205296cc040c3a4b97
parent99976859534bc320557586c8fa74ae3f0bd0b9dd (diff)
downloadbusybox-e18c75a563cf202a24effa8a4631dbf46bcc1575.tar.gz
Fixed init so it won't hang on reboot...
-rw-r--r--init.c11
-rw-r--r--init/init.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/init.c b/init.c
index 87746ef86..bf97fe5d6 100644
--- a/init.c
+++ b/init.c
@@ -56,7 +56,7 @@
static char *console = VT_CONSOLE;
static char *second_console = VT_SECONDARY;
static char *log = VT_LOG;
-
+static int kernel_version = 0;
/* try to open up the specified device */
@@ -350,9 +350,9 @@ static void shutdown_system(void)
waitfor(run( swap_off_cmd, console, FALSE));
waitfor(run( umount_cmd, console, FALSE));
sync();
- message(CONSOLE, "Skipping bdflush\r\n");
- if (get_kernel_revision() <= 2 * 65536 + 2 * 256 + 11) {
+ if (kernel_version > 0 && kernel_version <= 2 * 65536 + 2 * 256 + 11) {
/* bdflush, kupdate not needed for kernels >2.2.11 */
+ message(CONSOLE, "Flushing buffers.\r\n");
bdflush(1, 0);
sync();
}
@@ -445,9 +445,10 @@ extern int init_main(int argc, char **argv)
/* Mount /proc */
- if (mount ("proc", "/proc", "proc", 0, 0) == 0)
+ if (mount ("proc", "/proc", "proc", 0, 0) == 0) {
message(CONSOLE|LOG, "Mounting /proc: done.\n");
- else
+ kernel_version = get_kernel_revision();
+ } else
message(CONSOLE|LOG, "Mounting /proc: failed!\n");
/* Make sure there is enough memory to do something useful. */
diff --git a/init/init.c b/init/init.c
index 87746ef86..bf97fe5d6 100644
--- a/init/init.c
+++ b/init/init.c
@@ -56,7 +56,7 @@
static char *console = VT_CONSOLE;
static char *second_console = VT_SECONDARY;
static char *log = VT_LOG;
-
+static int kernel_version = 0;
/* try to open up the specified device */
@@ -350,9 +350,9 @@ static void shutdown_system(void)
waitfor(run( swap_off_cmd, console, FALSE));
waitfor(run( umount_cmd, console, FALSE));
sync();
- message(CONSOLE, "Skipping bdflush\r\n");
- if (get_kernel_revision() <= 2 * 65536 + 2 * 256 + 11) {
+ if (kernel_version > 0 && kernel_version <= 2 * 65536 + 2 * 256 + 11) {
/* bdflush, kupdate not needed for kernels >2.2.11 */
+ message(CONSOLE, "Flushing buffers.\r\n");
bdflush(1, 0);
sync();
}
@@ -445,9 +445,10 @@ extern int init_main(int argc, char **argv)
/* Mount /proc */
- if (mount ("proc", "/proc", "proc", 0, 0) == 0)
+ if (mount ("proc", "/proc", "proc", 0, 0) == 0) {
message(CONSOLE|LOG, "Mounting /proc: done.\n");
- else
+ kernel_version = get_kernel_revision();
+ } else
message(CONSOLE|LOG, "Mounting /proc: failed!\n");
/* Make sure there is enough memory to do something useful. */