summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-01-11 16:27:45 -0800
committerNick Mathewson <nickm@torproject.org>2013-01-11 16:36:54 -0800
commita5ee3834bf060c8a238be84ea7287bdfa8303a27 (patch)
treee8785e1ce22eed6e376e0e8bcc400bf7f0f02516 /src/ext
parentdffc8e359bcfeb00813a3afde6aa2328f6a6a476 (diff)
downloadtor-a5ee3834bf060c8a238be84ea7287bdfa8303a27.tar.gz
tor-a5ee3834bf060c8a238be84ea7287bdfa8303a27.zip
Handle EWOULDBLOCK as EAGAIN if they happen to be different.
Fixes bug 7935. Reported by 'oftc_must_be_destroyed'.
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/eventdns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ext/eventdns.c b/src/ext/eventdns.c
index 7e99f55626..b1f586b2fb 100644
--- a/src/ext/eventdns.c
+++ b/src/ext/eventdns.c
@@ -368,7 +368,11 @@ error_is_eagain(int err)
#define CLOSE_SOCKET(x) closesocket(x)
#else
#define last_error(sock) (errno)
+#if EAGAIN != EWOULDBLOCK
+#define error_is_eagain(err) ((err) == EAGAIN || (err) == EWOULDBLOCK)
+#else
#define error_is_eagain(err) ((err) == EAGAIN)
+#endif
#define CLOSE_SOCKET(x) close(x)
#endif