[or-cvs] Tor now builds on win32.

Nick Mathewson nickm at seul.org
Thu Aug 14 17:51:38 UTC 2003


Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv29200/src/common

Modified Files:
	fakepoll.c util.c util.h 
Log Message:
Tor now builds on win32.

Index: fakepoll.c
===================================================================
RCS file: /home/or/cvsroot/src/common/fakepoll.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- fakepoll.c	14 Aug 2003 17:13:51 -0000	1.7
+++ fakepoll.c	14 Aug 2003 17:51:36 -0000	1.8
@@ -66,7 +66,7 @@
 	}
 #ifdef MS_WINDOWS
         if (!any_fds_set) {
-                usleep(timeout);
+                Sleep(timeout);
                 return 0;
         }
 #endif

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- util.c	14 Aug 2003 17:13:51 -0000	1.14
+++ util.c	14 Aug 2003 17:51:36 -0000	1.15
@@ -116,6 +116,7 @@
     /* Child */
     func(data);
     assert(0); /* Should never reach here. */
+    return 0; /* suppress "control-reaches-end-of-non-void" warning. */
   } else {
     /* Parent */
     return 0;
@@ -236,7 +237,7 @@
 #ifdef MS_WINDOWS
 int correct_socket_errno(int s)
 {
-  int r, optval, optvallen=sizeof(optval);
+  int optval, optvallen=sizeof(optval);
   assert(errno == WSAEWOULDBLOCK);
   if (getsockopt(s, SOL_SOCKET, SO_ERROR, (void*)&optval, &optvallen))
     return errno;

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- util.h	14 Aug 2003 17:13:51 -0000	1.8
+++ util.h	14 Aug 2003 17:51:36 -0000	1.9
@@ -19,6 +19,7 @@
 #elif defined(_MSC_VER)
 #include <winsock.h>
 #endif
+#include <errno.h>
 #ifndef HAVE_GETTIMEOFDAY
 #ifdef HAVE_FTIME
 #define USING_FAKE_TIMEVAL
@@ -65,13 +66,9 @@
  * errnos which they use as the fancy strikes them.
  */
 #ifdef MS_WINDOWS
-#define ERRNO_EAGAIN(e)           ((e) == EAGAIN || \
-                                   (e) == WSAEWOULDBLOCK || \
-                                   (e) == EWOULDBLOCK)
-#define ERRNO_EINPROGRESS(e)      ((e) == EINPROGRESS || \
-                                   (e) == WSAEINPROGRESS)
-#define ERRNO_CONN_EINPROGRESS(e) ((e) == EINPROGRESS || \
-                                   (e) == WSAEINPROGRESS || (e) == WSAEINVAL)
+#define ERRNO_EAGAIN(e)           ((e) == EAGAIN || (e) == WSAEWOULDBLOCK)
+#define ERRNO_EINPROGRESS(e)      ((e) == WSAEINPROGRESS)
+#define ERRNO_CONN_EINPROGRESS(e) ((e) == WSAEINPROGRESS || (e) == WSAEINVAL)
 int correct_socket_errno(int s);
 #else
 #define ERRNO_EAGAIN(e)           ((e) == EAGAIN)



More information about the tor-commits mailing list