[or-cvs] check for EADDRINUSE in a cross-platform way (unless i"m wr...
arma at seul.org
arma at seul.org
Fri Feb 3 12:25:48 UTC 2006
Update of /home2/or/cvsroot/tor/src/common
In directory moria:/home/arma/work/onion/cvs/tor/src/common
Modified Files:
compat.h
Log Message:
check for EADDRINUSE in a cross-platform way (unless i'm wrong)
Index: compat.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/common/compat.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -p -d -r1.40 -r1.41
--- compat.h 14 Dec 2005 20:40:39 -0000 1.40
+++ compat.h 3 Feb 2006 12:25:46 -0000 1.41
@@ -189,6 +189,8 @@ int network_init(void);
* accept() has failed because we're out of fds or something. */
#define ERRNO_IS_ACCEPT_RESOURCE_LIMIT(e) \
((e) == WSAEMFILE || (e) == WSAENOBUFS)
+/** Return true if e is EADDRINUSE or the local equivalent. */
+#define ERRNO_IS_EADDRINUSE(e) ((e) == WSAEADDRINUSE)
int tor_socket_errno(int sock);
const char *tor_socket_strerror(int e);
#else
@@ -198,6 +200,7 @@ const char *tor_socket_strerror(int e);
#define ERRNO_IS_ACCEPT_EAGAIN(e) ((e) == EAGAIN || (e) == ECONNABORTED)
#define ERRNO_IS_ACCEPT_RESOURCE_LIMIT(e) \
((e) == EMFILE || (e) == ENFILE || (e) == ENOBUFS || (e) == ENOMEM)
+#define ERRNO_IS_EADDRINUSE(e) ((e) == EADDRINUSE)
#define tor_socket_errno(sock) (errno)
#define tor_socket_strerror(e) strerror(e)
#endif
More information about the tor-commits
mailing list