summaryrefslogtreecommitdiff
path: root/src/sockets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sockets.cpp')
-rw-r--r--src/sockets.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sockets.cpp b/src/sockets.cpp
index f255a4edf..7765d3066 100644
--- a/src/sockets.cpp
+++ b/src/sockets.cpp
@@ -282,10 +282,10 @@ ClientSocket *SocketIO::Accept(ListenSocket *s)
int newsock = accept(s->GetFD(), &conaddr.sa, &size);
#ifndef INVALID_SOCKET
-# define INVALID_SOCKET 0
+# define INVALID_SOCKET -1
#endif
- if (newsock > 0 && newsock != INVALID_SOCKET)
+ if (newsock >= 0 && newsock != INVALID_SOCKET)
return s->OnAccept(newsock, conaddr);
else
throw SocketException("Unable to accept connection: " + Anope::LastError());