summaryrefslogtreecommitdiff
path: root/accel-pppd/main.c
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-11-13 16:47:30 +0100
committerDmitry Kozlov <xeb@mail.ru>2018-11-16 10:42:30 +0300
commit7aedbea681303a2b934ee14a0498e4de2a44b7fb (patch)
tree67c7607f5d7235199b78572a56d06ee401c90c73 /accel-pppd/main.c
parent11addc80eda74b267e4f9d670688b15350283eda (diff)
downloadaccel-ppp-7aedbea681303a2b934ee14a0498e4de2a44b7fb.tar.gz
accel-ppp-7aedbea681303a2b934ee14a0498e4de2a44b7fb.zip
Don't wait for non-blocked signals
SIGSEGV, SIGILL, SIGFPE and SIGBUS aren't blocked, but they're added to the set of signals passed to sigwait(). This is confusing (should these signals be consumed by sigwait() or by their respective signal handler?) and is undefined according to the POSIX man page (http://man7.org/linux/man-pages/man3/sigwait.3p.html). In practice, sigwait() was only triggered when manually sending the signals to accel-pppd ("pkill -FPE accel-pppd"). On normal circumstances though, these signals are triggered by invalid operations run by the program. In these cases the signal handler was run and sigwait() wasn't woken up. So let's remove SIGSEGV, SIGILL, SIGFPE and SIGBUS from the set passed to sigwait(). This simplifies the code, avoids undefined behaviour and doesn't change accel-ppp behaviour for real-world use cases. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/main.c')
-rw-r--r--accel-pppd/main.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/accel-pppd/main.c b/accel-pppd/main.c
index e346f457..54a0db1f 100644
--- a/accel-pppd/main.c
+++ b/accel-pppd/main.c
@@ -356,10 +356,6 @@ int main(int _argc, char **_argv)
sigemptyset(&set);
sigaddset(&set, SIGTERM);
- sigaddset(&set, SIGSEGV);
- sigaddset(&set, SIGILL);
- sigaddset(&set, SIGFPE);
- sigaddset(&set, SIGBUS);
if (!no_sigint)
sigaddset(&set, SIGINT);