summaryrefslogtreecommitdiff
path: root/kike.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-06 21:35:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-06 21:35:44 +0200
commitc3d62b87996337130f7cdfe6787c92d882196be2 (patch)
tree515e0ca021dc3e5ef3c2b6754653245fd2f92281 /kike.c
parentec842db0fbd3e57b49d0b9a232bd102d54596d0f (diff)
downloadxK-c3d62b87996337130f7cdfe6787c92d882196be2.tar.gz
xK-c3d62b87996337130f7cdfe6787c92d882196be2.tar.xz
xK-c3d62b87996337130f7cdfe6787c92d882196be2.zip
Avoid the "poller_fd::closed" feature
Reliability enhancement for Linux. This feature was created for ponymap, however we don't care about an extra syscall in most places. Doing it right even saves lines.
Diffstat (limited to 'kike.c')
-rw-r--r--kike.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kike.c b/kike.c
index 4772c29..6073ea0 100644
--- a/kike.c
+++ b/kike.c
@@ -693,9 +693,8 @@ server_context_free (struct server_context *self)
for (size_t i = 0; i < self->n_listen_fds; i++)
{
- xclose (self->listen_fds[i]);
- self->listen_events[i].closed = true;
poller_fd_reset (&self->listen_events[i]);
+ xclose (self->listen_fds[i]);
}
free (self->listen_fds);
free (self->listen_events);
@@ -745,9 +744,8 @@ irc_initiate_quit (struct server_context *ctx)
for (size_t i = 0; i < ctx->n_listen_fds; i++)
{
- xclose (ctx->listen_fds[i]);
- ctx->listen_events[i].closed = true;
poller_fd_reset (&ctx->listen_events[i]);
+ xclose (ctx->listen_fds[i]);
}
ctx->n_listen_fds = 0;
@@ -933,6 +931,7 @@ client_kill (struct client *c, const char *reason)
xclose (c->socket_fd);
c->socket_fd = -1;
+ // We don't fork any children, this is okay
c->socket_event.closed = true;
poller_fd_reset (&c->socket_event);
client_cancel_timers (c);