aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-05-02 20:27:48 +0000
committerNick Mathewson <nickm@torproject.org>2004-05-02 20:27:48 +0000
commite6f3bf2a682ffaa7a8bebda4610a9d32b251cf01 (patch)
treecc58322435d003ef8d86810cbdda3446f62a7e0d
parent3dd1ef878364b7dee005d399076ff1da7118a748 (diff)
downloadtor-e6f3bf2a682ffaa7a8bebda4610a9d32b251cf01.tar.gz
tor-e6f3bf2a682ffaa7a8bebda4610a9d32b251cf01.zip
tor_assert(), not assert()
svn:r1777
-rw-r--r--src/common/fakepoll.c3
-rw-r--r--src/common/util.c4
-rw-r--r--src/common/util.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/common/fakepoll.c b/src/common/fakepoll.c
index 3051486b3a..e99065bfc8 100644
--- a/src/common/fakepoll.c
+++ b/src/common/fakepoll.c
@@ -26,7 +26,6 @@
#elif defined(_MSC_VER)
#include <winsock.h>
#endif
-#include <assert.h>
/* by default, windows handles only 64 fd's */
#if defined(MS_WINDOWS) && !defined(FD_SETSIZE)
@@ -61,7 +60,7 @@ tor_poll(struct pollfd *ufds, unsigned int nfds, int timeout)
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
diff --git a/src/common/util.c b/src/common/util.c
index eb02ee6ece..617c4c77aa 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1094,7 +1094,9 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
/* 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)
diff --git a/src/common/util.h b/src/common/util.h
index 1976e6ad54..465078aacb 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -256,7 +256,7 @@ const char *tor_socket_strerror(int e);
#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