summaryrefslogtreecommitdiff
path: root/src/socketengine_kqueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine_kqueue.cpp')
-rw-r--r--src/socketengine_kqueue.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socketengine_kqueue.cpp b/src/socketengine_kqueue.cpp
index e33f9f772..50f6242e2 100644
--- a/src/socketengine_kqueue.cpp
+++ b/src/socketengine_kqueue.cpp
@@ -61,15 +61,16 @@ bool KQueueEngine::AddFd(EventHandler* eh)
if (ref[fd])
return false;
- ref[fd] = eh;
-
struct kevent ke;
EV_SET(&ke, fd, eh->Readable() ? EVFILT_READ : EVFILT_WRITE, EV_ADD, 0, 0, NULL);
int i = kevent(EngineHandle, &ke, 1, 0, 0, NULL);
if (i == -1)
+ {
return false;
+ }
+ ref[fd] = eh;
CurrentSetSize++;
ServerInstance->Log(DEBUG,"New file descriptor: %d", fd);