[PATCH] init.c, halt command not working

Harald Küthe harald-tuxbox at arcor.de
Sun Mar 30 20:46:13 UTC 2008


Hello list,

(at least) the halt command is no longer working on our system (ppc32, 
linux-2.4.36)
Following patch makes it work again.

Best regards
Harald

--- busybox-1.10.0-orig/init/init.c    2008-03-22 02:31:51.000000000 +0100
+++ busybox-1.10.0/init/init.c    2008-03-30 22:22:02.000000000 +0200
@@ -372,7 +372,7 @@
     sigemptyset(&nmask);
     sigaddset(&nmask, SIGCHLD);
     sigprocmask(SIG_BLOCK, &nmask, &omask);
-    pid = vfork();
+    pid = BB_MMU ? fork() : vfork();
     sigprocmask(SIG_SETMASK, &omask, NULL);
 
     if (pid < 0)
@@ -529,7 +529,7 @@
     /* We have to fork here, since the kernel calls do_exit(0) in
      * linux/kernel/sys.c, which can cause the machine to panic when
      * the init process is killed.... */
-    pid = vfork();
+    pid = BB_MMU ? fork() : vfork();
     if (pid == 0) { /* child */
         reboot(magic);
         _exit(0);




More information about the busybox mailing list