aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-01-26 20:06:48 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-01-26 20:06:48 +0000
commitfa753f920b64a3f2c50295356e577a7c980c8408 (patch)
tree77236e83cc0583411a75b752a6152d445eb680e0 /init
parent67c5194a104e193ec26bad4013c2a9aa9d73312f (diff)
downloadbusybox-w32-fa753f920b64a3f2c50295356e577a7c980c8408.tar.gz
busybox-w32-fa753f920b64a3f2c50295356e577a7c980c8408.tar.bz2
busybox-w32-fa753f920b64a3f2c50295356e577a7c980c8408.zip
mount and umount could leak loop device allocations causing the system to
quickly run out. Also disable init's SIGHUP handler during shutdown. -Erik git-svn-id: svn://busybox.net/trunk/busybox@341 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r--init/init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index 5b80cc561..09540ff01 100644
--- a/init/init.c
+++ b/init/init.c
@@ -359,6 +359,7 @@ static pid_t run(char* command,
359 signal(SIGUSR2, SIG_DFL); 359 signal(SIGUSR2, SIG_DFL);
360 signal(SIGINT, SIG_DFL); 360 signal(SIGINT, SIG_DFL);
361 signal(SIGTERM, SIG_DFL); 361 signal(SIGTERM, SIG_DFL);
362 signal(SIGHUP, SIG_DFL);
362 363
363 if ((fd = device_open(terminal, O_RDWR)) < 0) { 364 if ((fd = device_open(terminal, O_RDWR)) < 0) {
364 message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal); 365 message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
@@ -458,6 +459,9 @@ goodnight:
458#ifndef DEBUG_INIT 459#ifndef DEBUG_INIT
459static void shutdown_system(void) 460static void shutdown_system(void)
460{ 461{
462 /* first disable our SIGHUP signal */
463 signal(SIGHUP, SIG_DFL);
464
461 /* Allow Ctrl-Alt-Del to reboot system. */ 465 /* Allow Ctrl-Alt-Del to reboot system. */
462 reboot(RB_ENABLE_CAD); 466 reboot(RB_ENABLE_CAD);
463 message(CONSOLE, "\r\nThe system is going down NOW !!\r\n"); 467 message(CONSOLE, "\r\nThe system is going down NOW !!\r\n");