aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-04-28 00:19:32 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-05-01 04:13:16 +0200
commitdc063b90cbf13a463c29ee5b81abeb07b6698473 (patch)
tree83a2fbeb983c695eb6030e47f7fb3f6904edb8b4 /handler.c
parentfa997aa2c153cef50941b4d4036694485259ac2a (diff)
downloadslcl-dc063b90cbf13a463c29ee5b81abeb07b6698473.tar.gz
Replace select(2) with poll(2)
select(2) has a number of well-known issues (e.g.: FD_SETSIZE limiting the maximum amount of file descriptors to watch) that are mostly solved by poll(2) and thus can be used as a drop-in replacement.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index 73ac9ab..795d503 100644
--- a/handler.c
+++ b/handler.c
@@ -233,7 +233,7 @@ int handler_listen(struct handler *const h, const short port)
for (;;)
{
bool exit, io;
- struct server_client *const c = server_select(h->server, &io, &exit);
+ struct server_client *const c = server_poll(h->server, &io, &exit);
if (exit)
{
@@ -242,7 +242,7 @@ int handler_listen(struct handler *const h, const short port)
}
else if (!c)
{
- fprintf(stderr, "%s: server_select failed\n", __func__);
+ fprintf(stderr, "%s: server_poll failed\n", __func__);
return -1;
}