From 3afaaa1e4a76d38dc90d9860b42e132342568d6e Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 28 Aug 2017 07:03:41 +0000 Subject: Catch signals with SA_RESTART unless iopause is select() --- src/libstddjb/skasigaction.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libstddjb/skasigaction.c') diff --git a/src/libstddjb/skasigaction.c b/src/libstddjb/skasigaction.c index 4b1ea8b..e86cc0c 100644 --- a/src/libstddjb/skasigaction.c +++ b/src/libstddjb/skasigaction.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include #include #include @@ -9,6 +10,9 @@ int skasigaction (int sig, struct skasigaction const *new, struct skasigaction * if (((new->flags & SKASA_MASKALL) ? sigfillset(&sanew.sa_mask) : sigemptyset(&sanew.sa_mask)) == -1) return -1 ; sanew.sa_handler = new->handler ; sanew.sa_flags = (new->flags & SKASA_NOCLDSTOP) ? SA_NOCLDSTOP : 0 ; +#ifndef SKALIBS_FLAG_PREFERSELECT + sanew.sa_flags |= SA_RESTART ; +#endif if (sigaction(sig, &sanew, &saold) < 0) return -1 ; if (old) { -- cgit v1.2.3