]> git.ozlabs.org Git - petitboot/commitdiff
discover: Fix accept() return value check
authorJeremy Kerr <jk@ozlabs.org>
Thu, 16 May 2013 08:23:19 +0000 (16:23 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 21 May 2013 07:29:43 +0000 (15:29 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/discover-server.c

index 138551ab2ddfa841a6e1533a884ee69541c02b30..2509457376e021d6bbdc20501d4bf358a5195fb8 100644 (file)
@@ -208,7 +208,7 @@ static int discover_server_process_connection(void *arg)
 
        /* accept the incoming connection */
        fd = accept(server->socket, NULL, 0);
 
        /* accept the incoming connection */
        fd = accept(server->socket, NULL, 0);
-       if (!fd) {
+       if (fd < 0) {
                pb_log("accept: %s\n", strerror(errno));
                return 0;
        }
                pb_log("accept: %s\n", strerror(errno));
                return 0;
        }