aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-05 05:08:54 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-05 05:08:54 -0400
commit7e8d7a017e130cc7855aa508e8a37321438b6e52 (patch)
tree8140c6d2ae46baa8dfab0fb934808a4f68f9e038 /src/common
parent46434ecf5b6f1ad88deb86fdac044c41ae4b534b (diff)
parente9b33ed1bf4140e3aeda5eb9126027fbe5a3ec5a (diff)
downloadtor-7e8d7a017e130cc7855aa508e8a37321438b6e52.tar
tor-7e8d7a017e130cc7855aa508e8a37321438b6e52.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 4efb0c8b8..42648bb04 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -500,6 +500,8 @@ int network_init(void);
* the actual errno after a socket operation fails.
*/
#if defined(_WIN32)
+/** Expands to WSA<b>e</b> on Windows, and to <b>e</b> elsewhere. */
+#define SOCK_ERRNO(e) WSA##e
/** Return true if e is EAGAIN or the local equivalent. */
#define ERRNO_IS_EAGAIN(e) ((e) == EAGAIN || (e) == WSAEWOULDBLOCK)
/** Return true if e is EINPROGRESS or the local equivalent. */
@@ -520,6 +522,7 @@ int network_init(void);
int tor_socket_errno(tor_socket_t sock);
const char *tor_socket_strerror(int e);
#else
+#define SOCK_ERRNO(e) e
#define ERRNO_IS_EAGAIN(e) ((e) == EAGAIN)
#define ERRNO_IS_EINPROGRESS(e) ((e) == EINPROGRESS)
#define ERRNO_IS_CONN_EINPROGRESS(e) ((e) == EINPROGRESS)