From: Roy Marples Date: Fri, 2 May 2014 20:56:10 +0000 (+0000) Subject: Accepted sockets should be marked non blocking. X-Git-Tag: v6.4.0~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=51a0c7b0eb8e550578eb98ab5c45a5a62417d7a7;p=thirdparty%2Fdhcpcd.git Accepted sockets should be marked non blocking. --- 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;