diff options
Diffstat (limited to 'ares/ares__close_sockets.c')
-rw-r--r-- | ares/ares__close_sockets.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ares/ares__close_sockets.c b/ares/ares__close_sockets.c index f1eaf26ad..48f49af9e 100644 --- a/ares/ares__close_sockets.c +++ b/ares/ares__close_sockets.c @@ -13,6 +13,8 @@ * without express or implied warranty. */ +#include "setup.h" + #include <stdlib.h> #ifdef WIN32 #else @@ -42,14 +44,14 @@ void ares__close_sockets(struct server_state *server) server->tcp_lenbuf_pos = 0; /* Close the TCP and UDP sockets. */ - if (server->tcp_socket != -1) + if (server->tcp_socket != ARES_SOCKET_BAD) { closesocket(server->tcp_socket); - server->tcp_socket = -1; + server->tcp_socket = ARES_SOCKET_BAD; } - if (server->udp_socket != -1) + if (server->udp_socket != ARES_SOCKET_BAD) { closesocket(server->udp_socket); - server->udp_socket = -1; + server->udp_socket = ARES_SOCKET_BAD; } } |