Patch from Frediano Ziglio: Windows compilation fixes on eventdns.c.

svn:r6971
This commit is contained in:
Nick Mathewson 2006-08-03 07:46:25 +00:00
parent e64825126b
commit 19cf66c0f1

View File

@ -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;