win: Redefine NSIG to consider SIGWINCH

Since SIGWINCH is being defined with a value above the existing NSIG,
redefine NSIG on WIN32.

PR-URL: https://github.com/libuv/libuv/pull/2032
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
This commit is contained in:
Jeremy Studer 2018-06-22 11:45:22 -04:00 committed by Santiago Gimeno
parent d0b15844dd
commit 20f2351886
No known key found for this signature in database
GPG Key ID: F28C3C8DA33C03BE
2 changed files with 9 additions and 1 deletions

View File

@ -86,6 +86,14 @@ typedef struct pollfd {
#define SIGKILL 9
#define SIGWINCH 28
/* Redefine NSIG to take SIGWINCH into consideration */
#if defined(NSIG) && NSIG <= SIGWINCH
# undef NSIG
#endif
#ifndef NSIG
# define NSIG SIGWINCH + 1
#endif
/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like
* platforms. However MinGW doesn't define it, so we do. */
#ifndef SIGABRT_COMPAT

View File

@ -190,7 +190,7 @@ int uv__signal_start(uv_signal_t* handle,
int signum,
int oneshot) {
/* Test for invalid signal values. */
if (signum != SIGWINCH && (signum <= 0 || signum >= NSIG))
if (signum <= 0 || signum >= NSIG)
return UV_EINVAL;
/* Short circuit: if the signal watcher is already watching {signum} don't go