diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-12-09 12:24:40 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-12-09 13:07:55 +1000 |
commit | c76c19abeb06a5336899ba9be194b478137be557 (patch) | |
tree | 51b5f1ed3336f59ce784c052be498c86e8a5c6b0 /jim-signal.c | |
parent | 63246ecaa29ff252387c6fb3f9d2554cacaf2d6c (diff) | |
download | jimtcl-c76c19abeb06a5336899ba9be194b478137be557.zip jimtcl-c76c19abeb06a5336899ba9be194b478137be557.tar.gz jimtcl-c76c19abeb06a5336899ba9be194b478137be557.tar.bz2 |
signal: don't define more than NSIG signals
If NSIG is defined, limit the number of supported signals to that number
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-signal.c')
-rw-r--r-- | jim-signal.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/jim-signal.c b/jim-signal.c index a819a92..feb8e19 100644 --- a/jim-signal.c +++ b/jim-signal.c @@ -12,7 +12,12 @@ #include <jim-subcmd.h> #include <jim-signal.h> -#define MAX_SIGNALS (sizeof(jim_wide) * 8) +#define MAX_SIGNALS_WIDE (sizeof(jim_wide) * 8) +#if defined(NSIG) + #define MAX_SIGNALS ((NSIG < MAX_SIGNALS_WIDE) ? NSIG : MAX_SIGNALS_WIDE) +#else + #define MAX_SIGNALS MAX_SIGNALS_WIDE +#endif static jim_wide *sigloc; static jim_wide sigsblocked; |