libev complete unix plat context init
authorAndy Green <andy.green@linaro.org>
Wed, 23 Dec 2015 03:55:06 +0000 (11:55 +0800)
committerAndy Green <andy.green@linaro.org>
Wed, 23 Dec 2015 03:55:06 +0000 (11:55 +0800)
https://github.com/warmcat/libwebsockets/issues/381

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/lws-plat-unix.c

index 5de6a8a..c972a36 100644 (file)
@@ -497,13 +497,13 @@ lws_plat_init(struct lws_context *context,
                return 1;
        }
 
-       if (lws_libev_init_fd_table(context))
-               /* libev handled it instead */
-               return 0;
+       if (!lws_libev_init_fd_table(context)) {
+               /* otherwise libev handled it instead */
 
-       if (pipe(context->dummy_pipe_fds)) {
-               lwsl_err("Unable to create pipe\n");
-               return 1;
+               if (pipe(context->dummy_pipe_fds)) {
+                       lwsl_err("Unable to create pipe\n");
+                       return 1;
+               }
        }
 
        /* use the read end of pipe as first item */