diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-01-21 17:14:01 -0800 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-01-21 17:14:01 -0800 |
commit | 9f44bfff6deaeef5f761ab76185f822bd59cfb8d (patch) | |
tree | e70316bb8e61b0984e138d768ba33a0ab805e000 | |
parent | dc325cd94f394dc1e018e5678deddd65a1e73a3a (diff) |
Make option setting work on Mac
-rw-r--r-- | src/core/iomgr/socket_utils_common_posix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/iomgr/socket_utils_common_posix.c b/src/core/iomgr/socket_utils_common_posix.c index d65b025d70..bd29e2b5fd 100644 --- a/src/core/iomgr/socket_utils_common_posix.c +++ b/src/core/iomgr/socket_utils_common_posix.c @@ -99,7 +99,7 @@ int grpc_set_socket_reuse_addr(int fd, int reuse) { socklen_t intlen = sizeof(newval); return 0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) && 0 == getsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &newval, &intlen) && - newval == val; + (newval != 0) == val; } /* disable nagle */ @@ -109,7 +109,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency) { socklen_t intlen = sizeof(newval); return 0 == setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)) && 0 == getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &newval, &intlen) && - newval == val; + (newval != 0) == val; } static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT; |