diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-28 07:03:41 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-28 07:03:41 +0000 |
commit | 3afaaa1e4a76d38dc90d9860b42e132342568d6e (patch) | |
tree | fa6950df9378163570a67d15f80f2fa76281db82 | |
parent | 3c8d5a7ca791a847112633c5778badfeb14bf4e8 (diff) | |
download | skalibs-3afaaa1e4a76d38dc90d9860b42e132342568d6e.tar.xz |
Catch signals with SA_RESTART unless iopause is select()
-rw-r--r-- | package/deps.mak | 2 | ||||
-rw-r--r-- | src/libstddjb/skasigaction.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/package/deps.mak b/package/deps.mak index 3bf37f1..7f839c8 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -482,7 +482,7 @@ src/libstddjb/skagetln_nofill.o src/libstddjb/skagetln_nofill.lo: src/libstddjb/ src/libstddjb/skagetlnsep.o src/libstddjb/skagetlnsep.lo: src/libstddjb/skagetlnsep.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/libstddjb/skalibs_tzisright.o src/libstddjb/skalibs_tzisright.lo: src/libstddjb/skalibs_tzisright.c src/libstddjb/djbtime-internal.h src/libstddjb/skasig_dfl.o src/libstddjb/skasig_dfl.lo: src/libstddjb/skasig_dfl.c src/include/skalibs/sig.h -src/libstddjb/skasigaction.o src/libstddjb/skasigaction.lo: src/libstddjb/skasigaction.c src/include/skalibs/sig.h +src/libstddjb/skasigaction.o src/libstddjb/skasigaction.lo: src/libstddjb/skasigaction.c src/include/skalibs/config.h src/include/skalibs/sig.h src/libstddjb/slurp.o src/libstddjb/slurp.lo: src/libstddjb/slurp.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/libstddjb/socket_accept4.o src/libstddjb/socket_accept4.lo: src/libstddjb/socket_accept4.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h src/libstddjb/socket_accept4_u32.o src/libstddjb/socket_accept4_u32.lo: src/libstddjb/socket_accept4_u32.c src/include/skalibs/socket.h src/include/skalibs/uint32.h 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) { |