From 09ee749006251e5c0a3de24919daee0182737989 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 9 Jun 2010 14:01:06 -0400 Subject: [PATCH] Move compat definition of NSIG to compat.h --HG-- branch : 1.7 --- compat.h | 11 +++++++++++ exec.c | 11 ----------- exec_pty.c | 11 ----------- mksiglist.c | 10 ---------- strsignal.c | 10 ---------- tgetpass.c | 10 ---------- 6 files changed, 11 insertions(+), 52 deletions(-) diff --git a/compat.h b/compat.h index dc1a2aea0..a57785480 100644 --- a/compat.h +++ b/compat.h @@ -295,6 +295,17 @@ const char *getprogname __P((void)); } while (0) #endif +/* Not all systems define NSIG in signal.h */ +#if !defined(NSIG) +# if defined(_NSIG) +# define NSIG _NSIG +# elif defined(__NSIG) +# define NSIG __NSIG +# else +# define NSIG 64 +# endif +#endif + #ifndef WCOREDUMP # define WCOREDUMP(x) ((x) & 0x80) #endif diff --git a/exec.c b/exec.c index c8a38546e..4cb521892 100644 --- a/exec.c +++ b/exec.c @@ -63,17 +63,6 @@ # include #endif -/* XXX - move to compat */ -#if !defined(NSIG) -# if defined(_NSIG) -# define NSIG _NSIG -# elif defined(__NSIG) -# define NSIG __NSIG -# else -# define NSIG 64 -# endif -#endif - #include "sudo.h" /* shared with exec_pty.c */ diff --git a/exec_pty.c b/exec_pty.c index 12ae533a1..ccea5dc3f 100644 --- a/exec_pty.c +++ b/exec_pty.c @@ -59,17 +59,6 @@ #include #include -/* XXX - move to compat.h */ -#if !defined(NSIG) -# if defined(_NSIG) -# define NSIG _NSIG -# elif defined(__NSIG) -# define NSIG __NSIG -# else -# define NSIG 64 -# endif -#endif - #include "sudo.h" #define SFD_STDIN 0 diff --git a/mksiglist.c b/mksiglist.c index e703aff78..09b141419 100644 --- a/mksiglist.c +++ b/mksiglist.c @@ -30,16 +30,6 @@ #include -#if !defined(NSIG) -# if defined(_NSIG) -# define NSIG _NSIG -# elif defined(__NSIG) -# define NSIG __NSIG -# else -# error one of NSIG, _NSIG, or __NSIG must be defined -# endif -#endif - int main(argc, argv) int argc; diff --git a/strsignal.c b/strsignal.c index f243015da..cead4ada1 100644 --- a/strsignal.c +++ b/strsignal.c @@ -20,16 +20,6 @@ #include #include -#if !defined(NSIG) -# if defined(_NSIG) -# define NSIG _NSIG -# elif defined(__NSIG) -# define NSIG __NSIG -# else -# error one of NSIG, _NSIG, or __NSIG must be defined -# endif -#endif - #if defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST == 1 # define my_sys_siglist sys_siglist #elif defined(HAVE_DECL__SYS_SIGLIST) && HAVE_DECL__SYS_SIGLIST == 1 diff --git a/tgetpass.c b/tgetpass.c index ed7e43561..1ab6f1cae 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -56,16 +56,6 @@ #include "sudo.h" -#if !defined(NSIG) -# if defined(_NSIG) -# define NSIG _NSIG -# elif defined(__NSIG) -# define NSIG __NSIG -# else -# define NSIG 64 -# endif -#endif - static volatile sig_atomic_t signo[NSIG]; static void handler __P((int)); -- 2.40.0