Avoid a possibility of fatal signal on non-Windows

This commit is contained in:
ANR2ME committed 2022-05-18 01:11:57 +07:00
1 parent 799c721fa6
commit ee2a24b19a
1 file changed
+7
+7
View File
@@ -303,6 +303,13 @@ int IsSocketReady(int fd, bool readfd, bool writefd, int* errorcode, int timeout
*errorcode = EBADF;
return SOCKET_ERROR;
}
#if !defined(_WIN32)
if (fd >= FD_SETSIZE) {
if (errorcode != nullptr)
*errorcode = EBADF;
return SOCKET_ERROR;
}
#endif
FD_ZERO(&readfds);
writefds = readfds;