summaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-03-17 08:29:08 +0000
committerDenis Vlasenko2008-03-17 08:29:08 +0000
commit3f165fa5b3b38fa4b321be94a97f06927f636fb1 (patch)
treed5e2d1045e714823c2e9a3ef912dcafeffcc9ebd /init/init.c
parent8e2cfec1cdf34068f2378aae9fe8f5ec0f821e21 (diff)
downloadbusybox-3f165fa5b3b38fa4b321be94a97f06927f636fb1.zip
busybox-3f165fa5b3b38fa4b321be94a97f06927f636fb1.tar.gz
libbb: introduce and use sigprocmask_allsigs and sigaction_set.
libbb: rename sig_pause to wait_for_any_sig.
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/init/init.c b/init/init.c
index 13410ac..1145c04 100644
--- a/init/init.c
+++ b/init/init.c
@@ -526,27 +526,13 @@ static void init_reboot(unsigned long magic)
static void kill_all_processes(void)
{
- sigset_t block_signals;
-
/* run everything to be run at "shutdown". This is done _prior_
* to killing everything, in case people wish to use scripts to
* shut things down gracefully... */
run_actions(SHUTDOWN);
/* first disable all our signals */
- sigfillset(&block_signals);
- /*sigemptyset(&block_signals);
- sigaddset(&block_signals, SIGHUP);
- sigaddset(&block_signals, SIGQUIT);
- sigaddset(&block_signals, SIGCHLD);
- sigaddset(&block_signals, SIGUSR1);
- sigaddset(&block_signals, SIGUSR2);
- sigaddset(&block_signals, SIGINT);
- sigaddset(&block_signals, SIGTERM);
- sigaddset(&block_signals, SIGCONT);
- sigaddset(&block_signals, SIGSTOP);
- sigaddset(&block_signals, SIGTSTP);*/
- sigprocmask(SIG_BLOCK, &block_signals, NULL);
+ sigprocmask_allsigs(SIG_BLOCK);
message(L_CONSOLE | L_LOG, "The system is going down NOW!");
@@ -593,26 +579,13 @@ static void halt_reboot_pwoff(int sig)
static void exec_restart_action(int sig ATTRIBUTE_UNUSED)
{
struct init_action *a;
- sigset_t unblock_signals;
for (a = init_action_list; a; a = a->next) {
if (a->action_type & RESTART) {
kill_all_processes();
/* unblock all signals (blocked in kill_all_processes()) */
- sigfillset(&unblock_signals);
- /*sigemptyset(&unblock_signals);
- sigaddset(&unblock_signals, SIGHUP);
- sigaddset(&unblock_signals, SIGQUIT);
- sigaddset(&unblock_signals, SIGCHLD);
- sigaddset(&unblock_signals, SIGUSR1);
- sigaddset(&unblock_signals, SIGUSR2);
- sigaddset(&unblock_signals, SIGINT);
- sigaddset(&unblock_signals, SIGTERM);
- sigaddset(&unblock_signals, SIGCONT);
- sigaddset(&unblock_signals, SIGSTOP);
- sigaddset(&unblock_signals, SIGTSTP);*/
- sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL);
+ sigprocmask_allsigs(SIG_UNBLOCK);
/* Open the new terminal device */
open_stdio_to_tty(a->terminal, 0 /* - halt if open fails */);