Commit 107902ba authored by Sergey Lyubka's avatar Sergey Lyubka

add_to_set(): fix around non-negative SOCKET on Windows

parent 9bbf4c83
......@@ -741,9 +741,11 @@ int ns_send(struct ns_connection *conn, const void *buf, int len) {
}
static void add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
if (sock >= 0) FD_SET(sock, set);
if (sock > *max_fd) {
*max_fd = sock;
if (sock != INVALID_SOCKET) {
FD_SET(sock, set);
if (*max_fd == INVALID_SOCKET || sock > *max_fd) {
*max_fd = sock;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment