diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-09-22 19:30:40 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-09-22 19:30:40 +0200 |
commit | 426aff88a0802b8da18292079f60f56388d0cdad (patch) | |
tree | b8db9ad15a0a79065ec297defd2273c30d2d0ca4 | |
parent | 1303962957fb900ed97c5958403990e885b06e29 (diff) | |
download | busybox-w32-426aff88a0802b8da18292079f60f56388d0cdad.tar.gz busybox-w32-426aff88a0802b8da18292079f60f56388d0cdad.tar.bz2 busybox-w32-426aff88a0802b8da18292079f60f56388d0cdad.zip |
init: hopefully fix "rebooting" in containers
function old new delta
pause_and_low_level_reboot 48 57 +9
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | init/init.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index 6439e2bcd..fde35f6b6 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -752,8 +752,13 @@ static void pause_and_low_level_reboot(unsigned magic) | |||
752 | reboot(magic); | 752 | reboot(magic); |
753 | _exit(EXIT_SUCCESS); | 753 | _exit(EXIT_SUCCESS); |
754 | } | 754 | } |
755 | while (1) | 755 | /* Used to have "while (1) sleep(1)" here. |
756 | sleep(1); | 756 | * However, in containers reboot() call is ignored, and with that loop |
757 | * we would eternally sleep here - not what we want. | ||
758 | */ | ||
759 | waitpid(pid, NULL, 0); | ||
760 | sleep(1); /* paranoia */ | ||
761 | _exit(EXIT_SUCCESS); | ||
757 | } | 762 | } |
758 | 763 | ||
759 | static void run_shutdown_and_kill_processes(void) | 764 | static void run_shutdown_and_kill_processes(void) |