summaryrefslogtreecommitdiff
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
parentdfca03df0761c526bba84af0baa37ac9dbb5b42d (diff)
downloadskalibs-94caf2cee5c03e037c465648eac8cb1dd32c7c73.tar.xz
Always pair skalibs/nsig.h with skalibs/nonposix.h (and screw NSIG with a chainsaw)
-rw-r--r--package/deps.mak7
-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
5 files changed, 26 insertions, 15 deletions
diff --git a/package/deps.mak b/package/deps.mak
index cd5223c..a33f169 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -31,7 +31,6 @@ src/include/skalibs/kolbak.h: src/include/skalibs/unixmessage.h
src/include/skalibs/lolstdio.h: src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/strerr2.h
src/include/skalibs/mininetstring.h: src/include/skalibs/stralloc.h
src/include/skalibs/netstring.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h
-src/include/skalibs/nsig.h: src/include/skalibs/nonposix.h
src/include/skalibs/random.h: src/include/skalibs/stralloc.h
src/include/skalibs/sha512.h: src/include/skalibs/uint64.h
src/include/skalibs/sig.h: src/include/skalibs/gccattributes.h
@@ -444,12 +443,12 @@ src/libstddjb/sanitize_read.o src/libstddjb/sanitize_read.lo: src/libstddjb/sani
src/libstddjb/sareadlink.o src/libstddjb/sareadlink.lo: src/libstddjb/sareadlink.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
src/libstddjb/satmp.o src/libstddjb/satmp.lo: src/libstddjb/satmp.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
src/libstddjb/sauniquename.o src/libstddjb/sauniquename.lo: src/libstddjb/sauniquename.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h src/include/skalibs/types.h
-src/libstddjb/selfpipe_finish.o src/libstddjb/selfpipe_finish.lo: src/libstddjb/selfpipe_finish.c src/include/skalibs/djbunix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_finish.o src/libstddjb/selfpipe_finish.lo: src/libstddjb/selfpipe_finish.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_init.o src/libstddjb/selfpipe_init.lo: src/libstddjb/selfpipe_init.c src/include/skalibs/djbunix.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_internal.o src/libstddjb/selfpipe_internal.lo: src/libstddjb/selfpipe_internal.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/libstddjb/selfpipe-internal.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_read.o src/libstddjb/selfpipe_read.lo: src/libstddjb/selfpipe_read.c src/include/skalibs/allreadwrite.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_trap.o src/libstddjb/selfpipe_trap.lo: src/libstddjb/selfpipe_trap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
-src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/selfpipe_untrap.o src/libstddjb/selfpipe_untrap.lo: src/libstddjb/selfpipe_untrap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/sgetopt.o src/libstddjb/sgetopt.lo: src/libstddjb/sgetopt.c src/include/skalibs/buffer.h src/include/skalibs/sgetopt.h
src/libstddjb/sig_block.o src/libstddjb/sig_block.lo: src/libstddjb/sig_block.c src/include/skalibs/sig.h
@@ -462,7 +461,7 @@ src/libstddjb/sig_pause.o src/libstddjb/sig_pause.lo: src/libstddjb/sig_pause.c
src/libstddjb/sig_push.o src/libstddjb/sig_push.lo: src/libstddjb/sig_push.c src/include/skalibs/sig.h
src/libstddjb/sig_restoreto.o src/libstddjb/sig_restoreto.lo: src/libstddjb/sig_restoreto.c src/include/skalibs/sig.h
src/libstddjb/sig_shield.o src/libstddjb/sig_shield.lo: src/libstddjb/sig_shield.c src/include/skalibs/sig.h
-src/libstddjb/sig_stack.o src/libstddjb/sig_stack.lo: src/libstddjb/sig_stack.c src/include/skalibs/nsig.h src/include/skalibs/sig.h
+src/libstddjb/sig_stack.o src/libstddjb/sig_stack.lo: src/libstddjb/sig_stack.c src/include/skalibs/nonposix.h src/include/skalibs/nsig.h src/include/skalibs/sig.h
src/libstddjb/sig_table.o src/libstddjb/sig_table.lo: src/libstddjb/sig_table.c src/libstddjb/sig-internal.h
src/libstddjb/sig_unblock.o src/libstddjb/sig_unblock.lo: src/libstddjb/sig_unblock.c src/include/skalibs/sig.h
src/libstddjb/sig_unshield.o src/libstddjb/sig_unshield.lo: src/libstddjb/sig_unshield.c src/include/skalibs/sig.h
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>