diff --git a/include/uv/win.h b/include/uv/win.h index d6b8b3a7..bb9477c8 100644 --- a/include/uv/win.h +++ b/include/uv/win.h @@ -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 diff --git a/src/win/signal.c b/src/win/signal.c index 3d0b8a35..276dc609 100644 --- a/src/win/signal.c +++ b/src/win/signal.c @@ -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