aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-20 00:08:23 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-20 00:08:23 +0200
commit97bcad8a03de3c40456f07d613c378bc9a07570a (patch)
treeb788e536c41640061a009e724ba5412b66c3f350 /utils.c
parent457eff90e3920d27d9d3806d2f44fa40de7af7dc (diff)
downloadponymap-97bcad8a03de3c40456f07d613c378bc9a07570a.tar.gz
ponymap-97bcad8a03de3c40456f07d613c378bc9a07570a.tar.xz
ponymap-97bcad8a03de3c40456f07d613c378bc9a07570a.zip
Save a syscall per connection
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c5
1 files changed, 3 insertions, 2 deletions
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)
{