aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-08-07 09:12:33 -0400
committerNick Mathewson <nickm@torproject.org>2015-08-07 09:12:33 -0400
commit720a9ccb2f4392ca12e9a473125e54c20c291d4a (patch)
tree8c7c72ff308e9639f5cbe81071a65b9ef7d1c65a /src/common/compat.h
parent9d1801b4b96d205d1896db754efbd54ecdf590d2 (diff)
downloadtor-720a9ccb2f4392ca12e9a473125e54c20c291d4a.tar.gz
tor-720a9ccb2f4392ca12e9a473125e54c20c291d4a.zip
Check for EINTR correctly on windows
(even though these are nonblocking calls and EINTR shouldn't be possible). Also, log what error we're seing if drain_fn fails.
Diffstat (limited to 'src/common/compat.h')
-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 11b41cded9..c667a01663 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -576,6 +576,8 @@ int network_init(void);
((e) == WSAEMFILE || (e) == WSAENOBUFS)
/** Return true if e is EADDRINUSE or the local equivalent. */
#define ERRNO_IS_EADDRINUSE(e) ((e) == WSAEADDRINUSE)
+/** Return true if e is EINTR or the local equivalent */
+#define ERRNO_IS_EINTR(e) ((e) == WSAEINTR || 0)
int tor_socket_errno(tor_socket_t sock);
const char *tor_socket_strerror(int e);
#else
@@ -586,6 +588,7 @@ const char *tor_socket_strerror(int e);
#else
#define ERRNO_IS_EAGAIN(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
#endif
+#define ERRNO_IS_EINTR(e) ((e) == EINTR || 0)
#define ERRNO_IS_EINPROGRESS(e) ((e) == EINPROGRESS || 0)
#define ERRNO_IS_CONN_EINPROGRESS(e) ((e) == EINPROGRESS || 0)
#define ERRNO_IS_ACCEPT_EAGAIN(e) \