diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-25 08:38:05 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-25 08:38:05 +0100 |
commit | 9234155749be0c9ee3ae1269f47c2240d302c21a (patch) | |
tree | 5838ff286ad8193b608e4574e64e1f652eaaccc9 | |
parent | bc5175023f3f0587391699d736071d1ccc4eff05 (diff) | |
download | dabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.tar.gz dabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.tar.bz2 dabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.zip |
Do not use undefinded SOCKET_ERROR
-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"); } |