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:
parent
d0b15844dd
commit
20f2351886
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user