From 97bcad8a03de3c40456f07d613c378bc9a07570a Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sat, 20 Sep 2014 00:08:23 +0200
Subject: Save a syscall per connection
---
utils.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'utils.c')
diff --git a/utils.c b/utils.c
index 209af08..a36533a 100644
--- a/utils.c
+++ b/utils.c
@@ -1161,8 +1161,9 @@ poller_remove_at_index (struct poller *self, size_t index)
fd->index = -1;
poller_remove_from_dispatch (self, fd);
- hard_assert (epoll_ctl (self->epoll_fd,
- EPOLL_CTL_DEL, fd->fd, (void *) "") != -1);
+ if (fd->fd != -1)
+ hard_assert (epoll_ctl (self->epoll_fd,
+ EPOLL_CTL_DEL, fd->fd, (void *) "") != -1);
if (index != --self->len)
{
--
cgit v1.2.3-70-g09d2