aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-11-09 00:15:11 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-11-09 00:15:11 +0000
commit3fa36e235021af5810333a52876d29efc661ad60 (patch)
tree71249d42a3a17ebf3c166826b71fe1453dcb6756 /init
parent73cc54388daeae391698b8afe788f421cf9e394d (diff)
downloadbusybox-w32-3fa36e235021af5810333a52876d29efc661ad60.tar.gz
busybox-w32-3fa36e235021af5810333a52876d29efc661ad60.tar.bz2
busybox-w32-3fa36e235021af5810333a52876d29efc661ad60.zip
*: a bit of code shrink
function old new delta stop_handler 41 38 -3 sulogin_main 508 504 -4 got_cont 4 - -4 cont_handler 11 - -11 startservice 309 297 -12 processorstart 423 409 -14 tcpudpsvd_main 1861 1843 -18 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 0/5 up/down: 0/-66) Total: -66 bytes
Diffstat (limited to 'init')
-rw-r--r--init/init.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c
index 3d171d71f..ef387819c 100644
--- a/init/init.c
+++ b/init/init.c
@@ -60,7 +60,6 @@ struct init_action {
60static struct init_action *init_action_list = NULL; 60static struct init_action *init_action_list = NULL;
61 61
62static const char *log_console = VC_5; 62static const char *log_console = VC_5;
63static sig_atomic_t got_cont = 0;
64 63
65enum { 64enum {
66 L_LOG = 0x1, 65 L_LOG = 0x1,
@@ -613,24 +612,21 @@ static void ctrlaltdel_signal(int sig UNUSED_PARAM)
613 run_actions(CTRLALTDEL); 612 run_actions(CTRLALTDEL);
614} 613}
615 614
615/* The SIGCONT handler is set to record_signo().
616 * It just sets bb_got_signal = SIGCONT. */
617
616/* The SIGSTOP & SIGTSTP handler */ 618/* The SIGSTOP & SIGTSTP handler */
617static void stop_handler(int sig UNUSED_PARAM) 619static void stop_handler(int sig UNUSED_PARAM)
618{ 620{
619 int saved_errno = errno; 621 int saved_errno = errno;
620 622
621 got_cont = 0; 623 bb_got_signal = 0;
622 while (!got_cont) 624 while (bb_got_signal == 0)
623 pause(); 625 pause();
624 626
625 errno = saved_errno; 627 errno = saved_errno;
626} 628}
627 629
628/* The SIGCONT handler */
629static void cont_handler(int sig UNUSED_PARAM)
630{
631 got_cont = 1;
632}
633
634static void new_init_action(uint8_t action_type, const char *command, const char *cons) 630static void new_init_action(uint8_t action_type, const char *command, const char *cons)
635{ 631{
636 struct init_action *a, *last; 632 struct init_action *a, *last;
@@ -808,7 +804,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
808 + (1 << SIGTERM) /* reboot */ 804 + (1 << SIGTERM) /* reboot */
809 , halt_reboot_pwoff); 805 , halt_reboot_pwoff);
810 signal(SIGINT, ctrlaltdel_signal); 806 signal(SIGINT, ctrlaltdel_signal);
811 signal(SIGCONT, cont_handler); 807 signal(SIGCONT, record_signo);
812 bb_signals(0 808 bb_signals(0
813 + (1 << SIGSTOP) 809 + (1 << SIGSTOP)
814 + (1 << SIGTSTP) 810 + (1 << SIGTSTP)