diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-05 16:20:05 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-05 16:20:05 +0200 |
commit | 5dadd497ffd9835a2860cf89ad781d1b513803dc (patch) | |
tree | 7ad8eb72b3cd1b5a3d94cd6d2ead9e86f2779c0a /runit/svlogd.c | |
parent | d3e1090308b6d3c55e01a2000a743b73605ddd7f (diff) | |
download | busybox-w32-5dadd497ffd9835a2860cf89ad781d1b513803dc.tar.gz busybox-w32-5dadd497ffd9835a2860cf89ad781d1b513803dc.tar.bz2 busybox-w32-5dadd497ffd9835a2860cf89ad781d1b513803dc.zip |
runsv: robustify signal handling - SIGTERM to child between vfork and exec could mess things up
While at it, rename bb_signals_recursive_norestart() to bb_signals_norestart():
"recursive" was implying we are setting SA_NODEFER allowing signal handler
to be entered recursively, but we do not do that.
function old new delta
bb_signals_norestart - 70 +70
startservice 380 394 +14
bb_signals_recursive_norestart 70 - -70
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 1/0 up/down: 84/-70) Total: 14 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit/svlogd.c')
-rw-r--r-- | runit/svlogd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c index 4490492e3..02c305696 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c | |||
@@ -1111,10 +1111,10 @@ int svlogd_main(int argc, char **argv) | |||
1111 | sigaddset(&blocked_sigset, SIGALRM); | 1111 | sigaddset(&blocked_sigset, SIGALRM); |
1112 | sigaddset(&blocked_sigset, SIGHUP); | 1112 | sigaddset(&blocked_sigset, SIGHUP); |
1113 | sigprocmask(SIG_BLOCK, &blocked_sigset, NULL); | 1113 | sigprocmask(SIG_BLOCK, &blocked_sigset, NULL); |
1114 | bb_signals_recursive_norestart(1 << SIGTERM, sig_term_handler); | 1114 | bb_signals_norestart(1 << SIGTERM, sig_term_handler); |
1115 | bb_signals_recursive_norestart(1 << SIGCHLD, sig_child_handler); | 1115 | bb_signals_norestart(1 << SIGCHLD, sig_child_handler); |
1116 | bb_signals_recursive_norestart(1 << SIGALRM, sig_alarm_handler); | 1116 | bb_signals_norestart(1 << SIGALRM, sig_alarm_handler); |
1117 | bb_signals_recursive_norestart(1 << SIGHUP, sig_hangup_handler); | 1117 | bb_signals_norestart(1 << SIGHUP, sig_hangup_handler); |
1118 | 1118 | ||
1119 | /* Without timestamps, we don't have to print each line | 1119 | /* Without timestamps, we don't have to print each line |
1120 | * separately, so we can look for _last_ newline, not first, | 1120 | * separately, so we can look for _last_ newline, not first, |