diff options
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 1a859a5a3f..53f8dc9c25 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1811,7 +1811,10 @@ rb_w32_fdclr(int fd, fd_set *set) int rb_w32_fdisset(int fd, fd_set *set) { - return __WSAFDIsSet(TO_SOCKET(fd), set); + SOCKET s = TO_SOCKET(fd); + if (!is_socket(s)) + return 0; + return __WSAFDIsSet(s, set); } // |