From 51a0c7b0eb8e550578eb98ab5c45a5a62417d7a7 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 2 May 2014 20:56:10 +0000 Subject: [PATCH] Accepted sockets should be marked non blocking. --- control.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/control.c b/control.c index c28d7905..2550da6b 100644 --- a/control.c +++ b/control.c @@ -107,6 +107,12 @@ control_handle(void *arg) close(fd); return; } + if ((flags = fcntl(fd, F_GETFL, 0)) == -1 || + fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) + { + close(fd); + return; + } l = malloc(sizeof(*l)); if (l) { l->ctx = ctx; -- 2.47.3