]> granicus.if.org Git - strace/commitdiff
Move NSIG ifdefery to a separate header file
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Dec 2016 23:18:21 +0000 (23:18 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Dec 2016 23:18:21 +0000 (23:18 +0000)
* nsig.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* signal.c: Include "nsig.h" instead of <signal.h>, remove
NSIG workarounds.
* sigreturn.c: Likewise.
* syscall.c: Likewise.
* tests/pselect6.c: Likewise.

Makefile.am
nsig.h [new file with mode: 0644]
signal.c
sigreturn.c
syscall.c
tests/pselect6.c

index 8444ed9c9abba34f0087f5f22cbb1b5401ba98e5..4840b93771fa634da507c6dedf79899e23e127d0 100644 (file)
@@ -170,6 +170,7 @@ strace_SOURCES =    \
        native_defs.h   \
        net.c           \
        netlink.c       \
+       nsig.h          \
        numa.c          \
        oldstat.c       \
        open.c          \
diff --git a/nsig.h b/nsig.h
new file mode 100644 (file)
index 0000000..4b00042
--- /dev/null
+++ b/nsig.h
@@ -0,0 +1,13 @@
+#ifndef STRACE_NSIG_H
+#define STRACE_NSIG_H
+
+#include <signal.h>
+
+#ifndef NSIG
+# warning NSIG is not defined, using 32
+# define NSIG  32
+#elif NSIG < 32
+# error NSIG < 32
+#endif
+
+#endif /* !STRACE_NSIG_H */
index ef7bed8884cda9077fd6dfd0e0b90b8380c276ba..4e18c6a071addd742c7b712102728f6752f9d966 100644 (file)
--- a/signal.c
+++ b/signal.c
  */
 
 #include "defs.h"
-#include <signal.h>
-
-#ifndef NSIG
-# warning NSIG is not defined, using 32
-# define NSIG 32
-#elif NSIG < 32
-# error NSIG < 32
-#endif
+#include "nsig.h"
 
 /* The libc headers do not define this constant since it should only be
    used by the implementation.  So we define it here.  */
index f0dab0da9adbcad6d59c0cebc5931b9a7126a939..b2eeb7a4a103154688df4dd3737eb659f9929b34 100644 (file)
@@ -1,5 +1,5 @@
 #include "defs.h"
-#include <signal.h>
+#include "nsig.h"
 #include "regs.h"
 #include "ptrace.h"
 
@@ -7,13 +7,6 @@
 # include <asm/sigcontext.h>
 #endif
 
-#ifndef NSIG
-# warning NSIG is not defined, using 32
-# define NSIG 32
-#elif NSIG < 32
-# error NSIG < 32
-#endif
-
 #include "arch_sigreturn.c"
 
 SYS_FUNC(sigreturn)
index e696b25f1c4d65b379756f3b28ff0f660cd29a82..6613a1e886fba28a53d797552a46f3e4fbd6068e 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -33,8 +33,8 @@
 
 #include "defs.h"
 #include "native_defs.h"
+#include "nsig.h"
 #include <sys/param.h>
-#include <signal.h>
 
 /* for struct iovec */
 #include <sys/uio.h>
 # define NT_PRSTATUS 1
 #endif
 
-#ifndef NSIG
-# warning: NSIG is not defined, using 32
-# define NSIG 32
-#endif
-
 #include "syscall.h"
 
 /* Define these shorthand notations to simplify the syscallent files. */
index b25995460a3e65fb91a2acce08dfa6c4d9c0ef8e..f8f10f5492fe2a539fe8869015500b2db7c649d3 100644 (file)
@@ -30,9 +30,9 @@
  */
 
 #include "tests.h"
+#include "nsig.h"
 #include <assert.h>
 #include <stdio.h>
-#include <signal.h>
 #include <unistd.h>
 #include <sys/select.h>
 #include <asm/unistd.h>
 
 #ifdef __NR_pselect6
 
-#ifndef NSIG
-# warning NSIG is not defined, using 32
-# define NSIG 32
-#endif
-
 static fd_set set[3][0x1000000 / sizeof(fd_set)];
 
 static void