Commit 2485a8f8 authored by Alexander Alashkin's avatar Alexander Alashkin Committed by Cesanta Bot

Fix signs comparison. Close cesanta/mongoose#774

PUBLISHED_FROM=a875606de6f4b2c202b25ce20efcb1ca33eb75b8
parent 1ae908f6
...@@ -3559,7 +3559,7 @@ void mg_socket_if_remove_conn(struct mg_connection *nc) { ...@@ -3559,7 +3559,7 @@ void mg_socket_if_remove_conn(struct mg_connection *nc) {
void mg_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) { void mg_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) {
if (sock != INVALID_SOCKET if (sock != INVALID_SOCKET
#ifdef __unix__ #ifdef __unix__
&& sock < FD_SETSIZE && sock < (sock_t) FD_SETSIZE
#endif #endif
) { ) {
FD_SET(sock, set); FD_SET(sock, set);
...@@ -3602,9 +3602,9 @@ time_t mg_socket_if_poll(struct mg_iface *iface, int timeout_ms) { ...@@ -3602,9 +3602,9 @@ time_t mg_socket_if_poll(struct mg_iface *iface, int timeout_ms) {
#ifdef __unix__ #ifdef __unix__
/* A hack to make sure all our file descriptos fit into FD_SETSIZE. */ /* A hack to make sure all our file descriptos fit into FD_SETSIZE. */
if (nc->sock >= FD_SETSIZE && try_dup) { if (nc->sock >= (sock_t) FD_SETSIZE && try_dup) {
int new_sock = dup(nc->sock); int new_sock = dup(nc->sock);
if (new_sock >= 0 && new_sock < FD_SETSIZE) { if (new_sock >= 0 && new_sock < (sock_t) FD_SETSIZE) {
closesocket(nc->sock); closesocket(nc->sock);
DBG(("new sock %d -> %d", nc->sock, new_sock)); DBG(("new sock %d -> %d", nc->sock, new_sock));
nc->sock = new_sock; nc->sock = new_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