summaryrefslogtreecommitdiffstats
path: root/src/Socket.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-25 08:38:05 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-25 08:38:05 +0100
commit9234155749be0c9ee3ae1269f47c2240d302c21a (patch)
tree5838ff286ad8193b608e4574e64e1f652eaaccc9 /src/Socket.h
parentbc5175023f3f0587391699d736071d1ccc4eff05 (diff)
downloaddabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.tar.gz
dabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.tar.bz2
dabmod-9234155749be0c9ee3ae1269f47c2240d302c21a.zip
Do not use undefinded SOCKET_ERROR
Diffstat (limited to 'src/Socket.h')
-rw-r--r--src/Socket.h7
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");
}