summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-04-28 11:16:35 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-04-28 11:16:35 +0000
commit94caf2cee5c03e037c465648eac8cb1dd32c7c73 (patch)
tree3e059edc0066bcda00e397f5b80eb7c85c7d460b /src
parentdfca03df0761c526bba84af0baa37ac9dbb5b42d (diff)
downloadskalibs-94caf2cee5c03e037c465648eac8cb1dd32c7c73.tar.xz
Always pair skalibs/nsig.h with skalibs/nonposix.h (and screw NSIG with a chainsaw)
Diffstat (limited to 'src')
-rw-r--r--src/include/skalibs/nsig.h6
-rw-r--r--src/libstddjb/selfpipe_finish.c10
-rw-r--r--src/libstddjb/selfpipe_trapset.c15
-rw-r--r--src/libstddjb/sig_stack.c3
4 files changed, 23 insertions, 11 deletions
diff --git a/src/include/skalibs/nsig.h b/src/include/skalibs/nsig.h
index 2cecda9..040be2c 100644
--- a/src/include/skalibs/nsig.h
+++ b/src/include/skalibs/nsig.h
@@ -1,8 +1,12 @@
/* ISC license. */
+/*
+ This header MUST be paired with skalibs/nonposix.h
+ which must be included before system headers.
+*/
+
#ifndef NSIG_H
-#include <skalibs/nonposix.h>
#include <signal.h>
#define SKALIBS_NSIG 65
diff --git a/src/libstddjb/selfpipe_finish.c b/src/libstddjb/selfpipe_finish.c
index 0635efb..fd9f6c2 100644
--- a/src/libstddjb/selfpipe_finish.c
+++ b/src/libstddjb/selfpipe_finish.c
@@ -3,13 +3,14 @@
/* MT-unsafe */
#include <skalibs/sysdeps.h>
+
+#ifdef SKALIBS_HASSIGNALFD
+
#include <signal.h>
#include <skalibs/djbunix.h>
#include "selfpipe-internal.h"
#include <skalibs/selfpipe.h>
-#ifdef SKALIBS_HASSIGNALFD
-
void selfpipe_finish (void)
{
sigprocmask(SIG_UNBLOCK, &selfpipe_caught, 0) ;
@@ -20,8 +21,13 @@ void selfpipe_finish (void)
#else
+#include <skalibs/nonposix.h>
+#include <signal.h>
#include <skalibs/sig.h>
#include <skalibs/nsig.h>
+#include <skalibs/djbunix.h>
+#include "selfpipe-internal.h"
+#include <skalibs/selfpipe.h>
void selfpipe_finish (void)
{
diff --git a/src/libstddjb/selfpipe_trapset.c b/src/libstddjb/selfpipe_trapset.c
index 33ac861..519e37b 100644
--- a/src/libstddjb/selfpipe_trapset.c
+++ b/src/libstddjb/selfpipe_trapset.c
@@ -1,16 +1,14 @@
/* ISC license. */
-/* MT-unsafe */
-
-#include <errno.h>
-#include <signal.h>
#include <skalibs/sysdeps.h>
-#include "selfpipe-internal.h"
-#include <skalibs/selfpipe.h>
#ifdef SKALIBS_HASSIGNALFD
+#include <errno.h>
+#include <signal.h>
#include <sys/signalfd.h>
+#include <skalibs/selfpipe.h>
+#include "selfpipe-internal.h"
int selfpipe_trapset (sigset_t const *set)
{
@@ -30,8 +28,13 @@ int selfpipe_trapset (sigset_t const *set)
#else
+#include <skalibs/nonposix.h>
+#include <errno.h>
+#include <signal.h>
#include <skalibs/sig.h>
#include <skalibs/nsig.h>
+#include <skalibs/selfpipe.h>
+#include "selfpipe-internal.h"
int selfpipe_trapset (sigset_t const *set)
{
diff --git a/src/libstddjb/sig_stack.c b/src/libstddjb/sig_stack.c
index 5897f63..f682971 100644
--- a/src/libstddjb/sig_stack.c
+++ b/src/libstddjb/sig_stack.c
@@ -1,7 +1,6 @@
/* ISC license. */
-/* MT-unsafe */
-
+#include <skalibs/nonposix.h>
#include <errno.h>
#include <signal.h>
#include <skalibs/sig.h>