Lines Matching refs:sig

1944 static void record_pending_signo(int sig)  in record_pending_signo()  argument
1946 sigaddset(&G.pending_set, sig); in record_pending_signo()
1948 if (sig == SIGCHLD) { in record_pending_signo()
1955 static sighandler_t install_sighandler(int sig, sighandler_t handler) in install_sighandler() argument
1969 sigaction(sig, &G.sa, &old_sa); in install_sighandler()
2017 static void sigexit(int sig) NORETURN;
2018 static void sigexit(int sig) in sigexit() argument
2031 if (sig <= 0) in sigexit()
2032 _exit(- sig); in sigexit()
2034 kill_myself_with_sig(sig); /* does not return */ in sigexit()
2043 static sighandler_t pick_sighandler(unsigned sig) in pick_sighandler() argument
2046 if (sig < sizeof(unsigned)*8) { in pick_sighandler()
2047 unsigned sigmask = (1 << sig); in pick_sighandler()
2120 int sig; in check_and_run_traps() local
2124 sig = 0; in check_and_run_traps()
2126 sig++; in check_and_run_traps()
2127 if (sigismember(&G.pending_set, sig)) { in check_and_run_traps()
2128 sigdelset(&G.pending_set, sig); in check_and_run_traps()
2131 } while (sig < NSIG); in check_and_run_traps()
2135 if (G_traps && G_traps[sig]) { in check_and_run_traps()
2136 debug_printf_exec("%s: sig:%d handler:'%s'\n", __func__, sig, G.traps[sig]); in check_and_run_traps()
2137 if (G_traps[sig][0]) { in check_and_run_traps()
2143 argv[1] = xstrdup(G_traps[sig]); in check_and_run_traps()
2158 last_sig = sig; in check_and_run_traps()
2164 switch (sig) { in check_and_run_traps()
2166 debug_printf_exec("%s: sig:%d default SIGINT handler\n", __func__, sig); in check_and_run_traps()
2168 last_sig = sig; in check_and_run_traps()
2176 debug_printf_exec("%s: sig:%d default SIGHUP handler\n", __func__, sig); in check_and_run_traps()
2191 debug_printf_exec("%s: sig:%d default SIGCHLD handler\n", __func__, sig); in check_and_run_traps()
2201 debug_printf_exec("%s: sig:%d default handling is to ignore\n", __func__, sig); in check_and_run_traps()
7285 unsigned sig = 0; in switch_off_special_sigs() local
7287 sig++; in switch_off_special_sigs()
7292 if (G_traps[sig] && !G_traps[sig][0]) in switch_off_special_sigs()
7295 free(G_traps[sig]); in switch_off_special_sigs()
7296 G_traps[sig] = NULL; in switch_off_special_sigs()
7300 install_sighandler(sig, SIG_DFL); in switch_off_special_sigs()
7315 IF_HUSH_TRAP(unsigned sig;) in reset_traps_to_defaults()
7341 for (sig = 0; sig < NSIG; sig++) { in reset_traps_to_defaults()
7342 if (!G_traps[sig]) in reset_traps_to_defaults()
7344 if (!G_traps[sig][0]) in reset_traps_to_defaults()
7347 free(G_traps[sig]); in reset_traps_to_defaults()
7348 G_traps[sig] = NULL; in reset_traps_to_defaults()
7350 if (sig == 0) in reset_traps_to_defaults()
7352 install_sighandler(sig, pick_sighandler(sig)); in reset_traps_to_defaults()
7395 int sig; in re_execute_shell() local
7396 for (sig = 1; sig < NSIG; sig++) { in re_execute_shell()
7397 if (G_traps[sig] && !G_traps[sig][0]) in re_execute_shell()
7398 empty_trap_mask |= 1LL << sig; in re_execute_shell()
8931 int sig = WTERMSIG(status); in process_wait_result() local
8940 puts(sig == SIGINT || sig == SIGPIPE ? "" : strsignal(sig)); in process_wait_result()
8947 ex = 128 | sig; in process_wait_result()
10062 unsigned sig = 0; in install_sighandlers() local
10064 sig++; in install_sighandlers()
10067 old_handler = install_sighandler(sig, pick_sighandler(sig)); in install_sighandlers()
10072 if (sig == SIGCHLD) in install_sighandlers()
10079 if (sig == SIGHUP && G_interactive_fd) in install_sighandlers()
10084 install_sighandler(sig, old_handler); in install_sighandlers()
10088 free(G_traps[sig]); in install_sighandlers()
10089 G_traps[sig] = xzalloc(1); /* == xstrdup(""); */ in install_sighandlers()
10408 IF_HUSH_TRAP(int sig;) in hush_main()
10412 for (sig = 1; sig < NSIG; sig++) { in hush_main()
10413 if (empty_trap_mask & (1LL << sig)) { in hush_main()
10414 G_traps[sig] = xzalloc(1); /* == xstrdup(""); */ in hush_main()
10415 install_sighandler(sig, SIG_IGN); in hush_main()
11017 unsigned sig = check_and_run_traps(); in builtin_read() local
11018 if (sig != SIGINT) in builtin_read()
11593 int sig; in builtin_trap() local
11620 sig = bb_strtou(*argv, NULL, 10); in builtin_trap()
11628 sig = get_signum(*argv++); in builtin_trap()
11629 if (sig < 0) { in builtin_trap()
11636 free(G_traps[sig]); in builtin_trap()
11637 G_traps[sig] = xstrdup(new_cmd); in builtin_trap()
11640 get_signame(sig), sig, G_traps[sig]); in builtin_trap()
11643 if (sig == 0) in builtin_trap()
11650 handler = pick_sighandler(sig); in builtin_trap()
11651 install_sighandler(sig, handler); in builtin_trap()
11869 int sig; in wait_for_child_or_signal() local
11941 sig = check_and_run_traps(); in wait_for_child_or_signal()
11942 if (sig /*&& sig != SIGCHLD - always true */) { in wait_for_child_or_signal()
11944 ret = 128 | sig; in wait_for_child_or_signal()