summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-08-28 07:03:41 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-08-28 07:03:41 +0000
commit3afaaa1e4a76d38dc90d9860b42e132342568d6e (patch)
treefa6950df9378163570a67d15f80f2fa76281db82 /src/libstddjb
parent3c8d5a7ca791a847112633c5778badfeb14bf4e8 (diff)
downloadskalibs-3afaaa1e4a76d38dc90d9860b42e132342568d6e.tar.xz
Catch signals with SA_RESTART unless iopause is select()
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/skasigaction.c4
1 files changed, 4 insertions, 0 deletions
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 <skalibs/config.h>
#include <signal.h>
#include <skalibs/sig.h>
@@ -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)
{