summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-12-09 12:12:11 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-12-09 12:12:11 +0000
commit7949f165a6e3dd42aa4548f1810f67bfef6eb20a (patch)
tree7cd4b0cc50f8172bc7faee53496002e12c817bf7
parentf45b6bf7cc452ce98484263392134cfbf9d05400 (diff)
downloaddrakx-7949f165a6e3dd42aa4548f1810f67bfef6eb20a.tar
drakx-7949f165a6e3dd42aa4548f1810f67bfef6eb20a.tar.gz
drakx-7949f165a6e3dd42aa4548f1810f67bfef6eb20a.tar.bz2
drakx-7949f165a6e3dd42aa4548f1810f67bfef6eb20a.tar.xz
drakx-7949f165a6e3dd42aa4548f1810f67bfef6eb20a.zip
seems that some neuneu do "init 0" or "init 6" instead of halt/reboot :(
-rw-r--r--mdk-stage1/init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index a618312bb..30385476b 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -429,7 +429,7 @@ int in_reboot(void)
int exit_value_proceed = 66;
-int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
+int main(int argc, char **argv)
{
pid_t installpid, childpid;
int wait_status;
@@ -437,6 +437,12 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))
int abnormal_termination = 0;
int end_stage2 = 0;
+ if (argc > 1 && argv[1][0] >= '0' && argv[1][0] <= '9') {
+ printf("This is no normal init, sorry.\n"
+ "Call `reboot' or `halt' directly.\n");
+ return 0;
+ }
+
/* getpid() != 1 should work, by linuxrc tends to get a larger pid */
testing = (getpid() > 50);