diff options
Diffstat (limited to 'src/core/iomgr')
-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; |