From: Roy Marples Date: Sat, 10 Nov 2012 17:29:34 +0000 (+0000) Subject: _NSIG seems to be the norm. Use _SIG_MAXSIG if available otherwise guess. X-Git-Tag: v5.99.3~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98397ca91d7ca888203ea9a378c8acc517aafb03;p=thirdparty%2Fdhcpcd.git _NSIG seems to be the norm. Use _SIG_MAXSIG if available otherwise guess. --- diff --git a/compat/posix_spawn.c b/compat/posix_spawn.c index 35dcf0fe..1e07f3b6 100644 --- a/compat/posix_spawn.c +++ b/compat/posix_spawn.c @@ -42,9 +42,13 @@ #include "../common.h" #include "posix_spawn.h" +#ifndef _NSIG +#ifdef _SIG_MAXSIG +#define _NSIG _SIG_MAXSIG + 1 +#else /* Guess */ -#ifndef _SIG_MAXSIG -#define _SIG_MAXSIG SIGPWR +#define _NSIG SIGPWR + 1 +#endif #endif extern char **environ; @@ -61,7 +65,7 @@ posix_spawnattr_handle(const posix_spawnattr_t *attrp) if (attrp->posix_attr_flags & POSIX_SPAWN_SETSIGDEF) { sa.sa_flags = 0; sa.sa_handler = SIG_DFL; - for (i = 1; i <= _SIG_MAXSIG; i++) { + for (i = 1; i < _NSIG; i++) { if (sigismember(&attrp->posix_attr_sigdefault, i)) { if (sigaction(i, &sa, NULL) == -1) return -1;