提交 7aedbea6 编写于 作者: G Guillaume Nault 提交者: Dmitry Kozlov

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: NGuillaume Nault <g.nault@alphalink.fr>
上级 11addc80
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册