summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorErik Andersen2000-01-26 20:06:48 +0000
committerErik Andersen2000-01-26 20:06:48 +0000
commit5cbdd712f5320ffc109053a94b7cf36c82292cf6 (patch)
tree77236e83cc0583411a75b752a6152d445eb680e0 /init
parent3fe39dce5d1a0b0946878c66bbd7f694c5aa38ea (diff)
downloadbusybox-5cbdd712f5320ffc109053a94b7cf36c82292cf6.zip
busybox-5cbdd712f5320ffc109053a94b7cf36c82292cf6.tar.gz
mount and umount could leak loop device allocations causing the system to
quickly run out. Also disable init's SIGHUP handler during shutdown. -Erik
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 5b80cc5..09540ff 100644
--- a/init/init.c
+++ b/init/init.c
@@ -359,6 +359,7 @@ static pid_t run(char* command,
signal(SIGUSR2, SIG_DFL);
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
+ signal(SIGHUP, SIG_DFL);
if ((fd = device_open(terminal, O_RDWR)) < 0) {
message(LOG|CONSOLE, "Bummer, can't open %s\r\n", terminal);
@@ -458,6 +459,9 @@ goodnight:
#ifndef DEBUG_INIT
static void shutdown_system(void)
{
+ /* first disable our SIGHUP signal */
+ signal(SIGHUP, SIG_DFL);
+
/* Allow Ctrl-Alt-Del to reboot system. */
reboot(RB_ENABLE_CAD);
message(CONSOLE, "\r\nThe system is going down NOW !!\r\n");