From 9234155749be0c9ee3ae1269f47c2240d302c21a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 25 Dec 2017 08:38:05 +0100 Subject: Do not use undefinded SOCKET_ERROR --- src/Socket.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Socket.h') 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"); } -- cgit v1.2.3