[or-cvs] tor_assert(), not assert()

Nick Mathewson nickm at seul.org
Sun May 2 20:27:50 UTC 2004


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

Modified Files:
	fakepoll.c util.c util.h 
Log Message:
tor_assert(), not assert()

Index: fakepoll.c
===================================================================
RCS file: /home/or/cvsroot/src/common/fakepoll.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- fakepoll.c	2 May 2004 20:23:35 -0000	1.25
+++ fakepoll.c	2 May 2004 20:27:48 -0000	1.26
@@ -25,8 +25,7 @@
 #include <ws2tcpip.h>
 #elif defined(_MSC_VER)
 #include <winsock.h>
-#endif
-#include <assert.h>
+#endif
 
 /* by default, windows handles only 64 fd's */
 #if defined(MS_WINDOWS) && !defined(FD_SETSIZE)
@@ -61,7 +60,7 @@
         for (idx = 0; idx < nfds; ++idx) {
                 ufds[idx].revents = 0;
                 fd = ufds[idx].fd;
-                assert (fd >= 0);
+                tor_assert(fd >= 0);
                 if (fd > maxfd) {
                   maxfd = fd;
 #ifdef MS_WINDOWS

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- util.c	2 May 2004 20:23:35 -0000	1.99
+++ util.c	2 May 2004 20:27:48 -0000	1.100
@@ -1094,7 +1094,9 @@
 
 /* On Windows, WSAEWOULDBLOCK is not always correct: when you see it,
  * you need to ask the socket for its actual errno.  Also, you need to
- * get your errors from WSAGetLastError, not errno.
+ * get your errors from WSAGetLastError, not errno.  (If you supply a
+ * socket of -1, we check WSAGetLastError, but don't correct
+ * WSAEWOULDBLOCKs.)
  */
 #ifdef MS_WINDOWS
 int tor_socket_errno(int sock)

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- util.h	2 May 2004 20:18:21 -0000	1.65
+++ util.h	2 May 2004 20:27:48 -0000	1.66
@@ -256,7 +256,7 @@
 #define ERRNO_IS_EINPROGRESS(e)      ((e) == EINPROGRESS)
 #define ERRNO_IS_CONN_EINPROGRESS(e) ((e) == EINPROGRESS)
 #define tor_socket_errno(sock)       (errno)
-#define tor_socket_strerror(e)              strerror(e)
+#define tor_socket_strerror(e)       strerror(e)
 #endif
 
 #endif



More information about the tor-commits mailing list