summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorDenis Vlasenko2008-11-09 00:15:11 +0000
committerDenis Vlasenko2008-11-09 00:15:11 +0000
commit3fa36e235021af5810333a52876d29efc661ad60 (patch)
tree71249d42a3a17ebf3c166826b71fe1453dcb6756 /init
parent73cc54388daeae391698b8afe788f421cf9e394d (diff)
downloadbusybox-3fa36e235021af5810333a52876d29efc661ad60.zip
busybox-3fa36e235021af5810333a52876d29efc661ad60.tar.gz
*: 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 3d171d7..ef38781 100644
--- a/init/init.c
+++ b/init/init.c
@@ -60,7 +60,6 @@ struct init_action {
static struct init_action *init_action_list = NULL;
static const char *log_console = VC_5;
-static sig_atomic_t got_cont = 0;
enum {
L_LOG = 0x1,
@@ -613,24 +612,21 @@ static void ctrlaltdel_signal(int sig UNUSED_PARAM)
run_actions(CTRLALTDEL);
}
+/* The SIGCONT handler is set to record_signo().
+ * It just sets bb_got_signal = SIGCONT. */
+
/* The SIGSTOP & SIGTSTP handler */
static void stop_handler(int sig UNUSED_PARAM)
{
int saved_errno = errno;
- got_cont = 0;
- while (!got_cont)
+ bb_got_signal = 0;
+ while (bb_got_signal == 0)
pause();
errno = saved_errno;
}
-/* The SIGCONT handler */
-static void cont_handler(int sig UNUSED_PARAM)
-{
- got_cont = 1;
-}
-
static void new_init_action(uint8_t action_type, const char *command, const char *cons)
{
struct init_action *a, *last;
@@ -808,7 +804,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
+ (1 << SIGTERM) /* reboot */
, halt_reboot_pwoff);
signal(SIGINT, ctrlaltdel_signal);
- signal(SIGCONT, cont_handler);
+ signal(SIGCONT, record_signo);
bb_signals(0
+ (1 << SIGSTOP)
+ (1 << SIGTSTP)