From: Todd C. Miller Date: Wed, 9 Jun 2010 17:57:07 +0000 (-0400) Subject: Move compat definition of NSIG to compat.h X-Git-Tag: SUDO_1_8_0~501 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5a6ca998a9b86167d26567f4ba17395308b22ee;p=sudo Move compat definition of NSIG to compat.h --- diff --git a/compat/mksiglist.c b/compat/mksiglist.c index 84d2ead4b..d9ba37073 100644 --- a/compat/mksiglist.c +++ b/compat/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(int argc, char *argv[]) { diff --git a/compat/strsignal.c b/compat/strsignal.c index 5817f1f0f..a2c7a8875 100644 --- a/compat/strsignal.c +++ b/compat/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/include/compat.h b/include/compat.h index c686270c8..400484566 100644 --- a/include/compat.h +++ b/include/compat.h @@ -287,6 +287,17 @@ void setprogname(const char *); } 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/src/exec.c b/src/exec.c index c46db05bb..5791eb427 100644 --- a/src/exec.c +++ b/src/exec.c @@ -56,18 +56,7 @@ #include #include -/* 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" /* XXX? */ +#include "sudo.h" #include "sudo_plugin.h" #include "sudo_plugin_int.h" diff --git a/src/exec_pty.c b/src/exec_pty.c index 87082e360..aeb68a25e 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -55,18 +55,7 @@ #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" /* XXX? */ +#include "sudo.h" #include "sudo_plugin.h" #include "sudo_plugin_int.h" diff --git a/src/tgetpass.c b/src/tgetpass.c index 48e8f0f23..7020c4b46 100644 --- a/src/tgetpass.c +++ b/src/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(int);