From 31c614d6916c5573eb11a25cce996c5e3afbb5f0 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 22 Aug 2021 16:03:17 +0200 Subject: Fixed poll behaviour --- plop.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plop.c') diff --git a/plop.c b/plop.c index a1de2d0..d477036 100644 --- a/plop.c +++ b/plop.c @@ -241,6 +241,12 @@ int plop_handle_server(const int server) } } + if (-1 == fcntl(client, F_SETFL, fcntl(client, F_GETFL, 0) | O_NONBLOCK)) + { + close(client); + return 0; // TODO: Revisit error handling in server. + } + struct connection * connection = connection_new(client); if (NULL == connection) return -1; -- cgit v1.1