libbb: introduse and use signal_[no_]SA_RESTART_empty_mask and sigaction_set

signal_SA_RESTART_empty_mask                           -      65     +65
signal_no_SA_RESTART_empty_mask                        -      54     +54
dd_main                                             1325    1369     +44
sigaction_set                                          -      19     +19
dname_enc                                            373     377      +4
UNSPEC_print                                          64      66      +2
setsignal                                            296     294      -2
bb_signals_recursive                                  95      92      -3
bb_askpass                                           367     361      -6
inetd_main                                          1810    1797     -13
rx_main                                              912     883     -29
sigdelset                                             32       -     -32
__sigdelset                                           32       -     -32
__GI_sigdelset                                        32       -     -32
sighup_handler                                        84      37     -47
arping_main                                         1844    1797     -47
fsck_main                                           1869    1807     -62
run_list                                            1917    1844     -73
vlock_main                                           492     409     -83
progressmeter                                        883     798     -85
handle_incoming_and_exit                            2737    2651     -86
------------------------------------------------------------------------------
(add/remove: 3/3 grow/shrink: 3/12 up/down: 188/-632)        Total: -444 bytes
This commit is contained in:
Denis Vlasenko
2008-03-12 23:19:35 +00:00
parent 4cf1d08fc2
commit 8e2cfec1cd
14 changed files with 60 additions and 83 deletions

View File

@@ -1179,15 +1179,15 @@ int inetd_main(int argc, char **argv)
sigaddset(&sa.sa_mask, SIGCHLD);
sigaddset(&sa.sa_mask, SIGHUP);
sa.sa_handler = retry_network_setup;
sigaction(SIGALRM, &sa, NULL);
sigaction_set(SIGALRM, &sa);
sa.sa_handler = reread_config_file;
sigaction(SIGHUP, &sa, NULL);
sigaction_set(SIGHUP, &sa);
sa.sa_handler = reap_child;
sigaction(SIGCHLD, &sa, NULL);
sigaction_set(SIGCHLD, &sa);
sa.sa_handler = clean_up_and_exit;
sigaction(SIGTERM, &sa, NULL);
sigaction_set(SIGTERM, &sa);
sa.sa_handler = clean_up_and_exit;
sigaction(SIGINT, &sa, NULL);
sigaction_set(SIGINT, &sa);
sa.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sa, &saved_pipe_handler);
@@ -1382,7 +1382,7 @@ int inetd_main(int argc, char **argv)
* for nowait stream children */
for (sep2 = serv_list; sep2; sep2 = sep2->se_next)
maybe_close(sep2->se_fd);
sigaction(SIGPIPE, &saved_pipe_handler, NULL);
sigaction_set(SIGPIPE, &saved_pipe_handler);
unblock_sigs(&omask);
BB_EXECVP(sep->se_program, sep->se_argv);
bb_perror_msg("exec %s", sep->se_program);