summaryrefslogtreecommitdiffhomepage
path: root/plop.c
diff options
context:
space:
mode:
Diffstat (limited to 'plop.c')
-rw-r--r--plop.c6
1 files changed, 6 insertions, 0 deletions
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;