[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Fix windows compilation
Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv12687/src/common
Modified Files:
compat.c
Log Message:
Fix windows compilation
Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- compat.c 30 Jun 2005 07:17:38 -0000 1.58
+++ compat.c 13 Jul 2005 15:24:33 -0000 1.59
@@ -160,7 +160,7 @@
end = haystack + hlen;
first = *(const char*)needle;
while ((p = memchr(p, first, end-p))) {
- if (end-p >= nlen)
+ if (p+nlen >= end)
return NULL;
if (!memcmp(p, needle, nlen))
return p;
@@ -340,7 +340,11 @@
if (!SOCKET_IS_POLLABLE(listener)) {
log_fn(LOG_WARN, "Too many connections; can't open socketpair");
tor_close_socket(listener);
+#ifdef MS_WINDOWS
+ return -ENFILE;
+#else
return -ENCONN;
+#endif
}
memset(&listen_addr, 0, sizeof(listen_addr));
listen_addr.sin_family = AF_INET;