summaryrefslogtreecommitdiff
path: root/ares_fds.c
diff options
context:
space:
mode:
Diffstat (limited to 'ares_fds.c')
-rw-r--r--ares_fds.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/ares_fds.c b/ares_fds.c
index dd91745..0740a98 100644
--- a/ares_fds.c
+++ b/ares_fds.c
@@ -26,7 +26,8 @@
int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
{
struct server_state *server;
- int i, nfds;
+ ares_socket_t nfds;
+ int i;
/* No queries, no file descriptors. */
if (!channel->queries)
@@ -37,19 +38,19 @@ int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
{
server = &channel->servers[i];
if (server->udp_socket != ARES_SOCKET_BAD)
- {
- FD_SET(server->udp_socket, read_fds);
- if (server->udp_socket >= nfds)
- nfds = server->udp_socket + 1;
- }
+ {
+ FD_SET(server->udp_socket, read_fds);
+ if (server->udp_socket >= nfds)
+ nfds = server->udp_socket + 1;
+ }
if (server->tcp_socket != ARES_SOCKET_BAD)
- {
- FD_SET(server->tcp_socket, read_fds);
- if (server->qhead)
- FD_SET(server->tcp_socket, write_fds);
- if (server->tcp_socket >= nfds)
- nfds = server->tcp_socket + 1;
- }
+ {
+ FD_SET(server->tcp_socket, read_fds);
+ if (server->qhead)
+ FD_SET(server->tcp_socket, write_fds);
+ if (server->tcp_socket >= nfds)
+ nfds = server->tcp_socket + 1;
+ }
}
- return nfds;
+ return (int)nfds;
}