From 97bcad8a03de3c40456f07d613c378bc9a07570a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Sat, 20 Sep 2014 00:08:23 +0200
Subject: Save a syscall per connection
---
ponymap.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
(limited to 'ponymap.c')
diff --git a/ponymap.c b/ponymap.c
index c1a19a3..d0b71ee 100644
--- a/ponymap.c
+++ b/ponymap.c
@@ -512,13 +512,16 @@ unit_abort (struct unit *u)
if (u->service->on_aborted)
u->service->on_aborted (u->service_data, u);
- poller_timer_reset (&u->timeout_event);
- poller_fd_reset (&u->fd_event);
-
u->transport->cleanup (u);
u->service->scan_free (u->service_data);
xclose (u->socket_fd);
+ poller_timer_reset (&u->timeout_event);
+
+ // This way we avoid a syscall with epoll
+ u->fd_event.fd = -1;
+ poller_fd_reset (&u->fd_event);
+
u->transport_data = NULL;
u->service_data = NULL;
u->socket_fd = -1;
--
cgit v1.2.3