coverity 83660 plat unix check fcntl return
authorAndy Green <andy.green@linaro.org>
Sun, 30 Nov 2014 05:02:32 +0000 (13:02 +0800)
committerAndy Green <andy.green@linaro.org>
Sun, 30 Nov 2014 05:10:26 +0000 (13:10 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/lws-plat-unix.c

index 467e394..cc1c125 100644 (file)
@@ -234,7 +234,8 @@ lws_plat_set_socket_options(struct libwebsocket_context *context, int fd)
 #endif
 
        /* We are nonblocking... */
-       fcntl(fd, F_SETFL, O_NONBLOCK);
+       if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
+               return 1;
 
        return 0;
 }