[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r6971: Patch from Frediano Ziglio: Windows compilation fixes on eve (tor/trunk/src/or)



Author: nickm
Date: 2006-08-03 03:46:25 -0400 (Thu, 03 Aug 2006)
New Revision: 6971

Modified:
   tor/trunk/src/or/eventdns.c
Log:
Patch from Frediano Ziglio: Windows compilation fixes on eventdns.c.

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2006-08-03 04:23:45 UTC (rev 6970)
+++ tor/trunk/src/or/eventdns.c	2006-08-03 07:46:25 UTC (rev 6971)
@@ -1186,8 +1186,8 @@
 	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 @@
 	return 0;
 
 out2:
+#ifdef MS_WINDOWS
+	closesocket(ns->socket);
+#else
 	close(ns->socket);
+#endif
 out1:
 	free(ns);
 	return err;