mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
Fix signs comparison. Close cesanta/mongoose#774
PUBLISHED_FROM=a875606de6f4b2c202b25ce20efcb1ca33eb75b8
This commit is contained in:
1 parent
1ae908f6d5
commit
2485a8f8d9
1 file changed
+3
-3
+3
-3
@@ -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) {
|
|||||||
|
|
||||||
#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;
|
||||||
|
|||||||
Reference in new issue
Block a user