]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Accepted sockets should be marked non blocking.
authorRoy Marples <roy@marples.name>
Fri, 2 May 2014 20:56:10 +0000 (20:56 +0000)
committerRoy Marples <roy@marples.name>
Fri, 2 May 2014 20:56:10 +0000 (20:56 +0000)
control.c

index c28d790518c68db9eb3a38bc288228df7a68896a..2550da6b12b2095a9a67ce0a5f5950c4cb07bc40 100644 (file)
--- 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;