Move NSIG ifdefery to a separate header file

* 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.
This commit is contained in:
Дмитрий Левин 2016-12-27 23:18:21 +00:00
parent f91679316b
commit 5a25466437
6 changed files with 18 additions and 28 deletions

View File

@ -170,6 +170,7 @@ strace_SOURCES = \
native_defs.h \
net.c \
netlink.c \
nsig.h \
numa.c \
oldstat.c \
open.c \

13
nsig.h Normal file
View File

@ -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 */

View File

@ -32,14 +32,7 @@
*/
#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. */

View 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)

View File

@ -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>
@ -63,11 +63,6 @@
# 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. */

View 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>
@ -40,11 +40,6 @@
#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