diff options
Diffstat (limited to 'src/Socket.h')
-rw-r--r-- | src/Socket.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Socket.h b/src/Socket.h index 5145103..392e758 100644 --- a/src/Socket.h +++ b/src/Socket.h @@ -52,8 +52,8 @@ class TCPSocket { #if defined(HAVE_SO_NOSIGPIPE) int val = 1; - if (setsockopt(m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof(val)) - == SOCKET_ERROR) { + if (setsockopt(m_sock, SOL_SOCKET, SO_NOSIGPIPE, + &val, sizeof(val)) < 0) { throw std::runtime_error("Can't set SO_NOSIGPIPE"); } #endif @@ -97,7 +97,8 @@ class TCPSocket { addr.sin_addr.s_addr = htonl(INADDR_ANY); const int reuse = 1; - if (setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)) < 0) { + if (setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, + &reuse, sizeof(reuse)) < 0) { throw std::runtime_error("Can't reuse address for TCP socket"); } |