aboutsummaryrefslogtreecommitdiff
path: root/src/or/eventdns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-03 07:46:25 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-03 07:46:25 +0000
commit19cf66c0f1b509aa5b3e63bc7b3749ede273fe34 (patch)
tree97c507c7ec5b54579a155d3cb3dad3c5f6cb53d3 /src/or/eventdns.c
parente64825126be156bae394f9822dac9b91a3f23970 (diff)
downloadtor-19cf66c0f1b509aa5b3e63bc7b3749ede273fe34.tar
tor-19cf66c0f1b509aa5b3e63bc7b3749ede273fe34.tar.gz
Patch from Frediano Ziglio: Windows compilation fixes on eventdns.c.
svn:r6971
Diffstat (limited to 'src/or/eventdns.c')
-rw-r--r--src/or/eventdns.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 88a512f51..583f8f728 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -1186,8 +1186,8 @@ eventdns_nameserver_add(unsigned long int address) {
if (ns->socket < 0) { err = 1; goto out1; }
#ifdef MS_WINDOWS
{
- int nonblocking = 1;
- ioctlsocket(socket, FIONBIO, (unsigned long*) &nonblocking);
+ u_long nonblocking = 1;
+ ioctlsocket(ns->socket, FIONBIO, &nonblocking);
}
#else
fcntl(ns->socket, F_SETFL, O_NONBLOCK);
@@ -1223,7 +1223,11 @@ eventdns_nameserver_add(unsigned long int address) {
return 0;
out2:
+#ifdef MS_WINDOWS
+ closesocket(ns->socket);
+#else
close(ns->socket);
+#endif
out1:
free(ns);
return err;