From ba955592eb8ea602e819e9b7e834b9b593547dc6 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 29 Jan 2016 08:38:47 +0800 Subject: [PATCH] libev complete unix plat context init https://github.com/warmcat/libwebsockets/issues/381 Signed-off-by: Andy Green --- lib/lws-plat-unix.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 5de6a8a93..c972a3655 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -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 */