diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-11-19 00:13:58 +1100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2015-11-19 00:13:58 +1100 |
commit | a1ce111d32a105ce09e17974800e6cc3e239e60f (patch) | |
tree | 2a20a8c8ff25d22d03e2618f690fc2a2680fb4f5 /src/test | |
parent | eed86892ddac634be61ddf5bcb8deb23d86512c4 (diff) | |
download | tor-a1ce111d32a105ce09e17974800e6cc3e239e60f.tar.gz tor-a1ce111d32a105ce09e17974800e6cc3e239e60f.zip |
Really Really Fixup 86eba14ac549: Windows support, error return values
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 15eb2cf3b0..187cb23125 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -4342,11 +4342,8 @@ fd_is_nonblocking(tor_socket_t fd) } #endif -#ifdef EPROTONOSUPPORT -#define SOCKET_EPROTO(s) (s == -EPROTONOSUPPORT) -#else -#define SOCKET_EPROTO(s) (0) -#endif +#define ERRNO_IS_EPROTO(e) (e == SOCK_ERRNO(EPROTONOSUPPORT)) +#define SOCK_ERR_IS_EPROTO(s) ERRNO_IS_EPROTO(tor_socket_errno(s)) /* Test for tor_open_socket*, using IPv4 or IPv6 depending on arg. */ static void @@ -4364,7 +4361,7 @@ test_util_socket(void *arg) (void)arg; fd1 = tor_open_socket_with_extensions(domain, SOCK_STREAM, 0, 0, 0); - if (SOCKET_EPROTO(fd1)) { + if (SOCK_ERR_IS_EPROTO(fd1)) { /* Assume we're on an IPv4-only or IPv6-only system, and give up now. */ goto done; } @@ -4427,7 +4424,7 @@ test_util_socketpair(void *arg) int socketpair_result = 0; socketpair_result = tor_socketpair_fn(family, SOCK_STREAM, 0, fds); - if (ersatz && SOCKET_EPROTO(socketpair_result)) { + if (ersatz && ERRNO_IS_EPROTO(-socketpair_result)) { /* Assume we're on an IPv6-only system, and give up now. * (tor_ersatz_socketpair uses IPv4.) */ goto done; |