From 30c3b57493557648b4ac30c07b0741faef9a52b1 Mon Sep 17 00:00:00 2001
From: GeorgyKirichenko <kirichenkoga@gmail.com>
Date: Fri, 5 Feb 2016 12:17:16 +0300
Subject: [PATCH] If libev uses eventfd instead of pipe then evpipe[0] can be
 -1. Check evpipe[1] is the right way. Issue #1094.

---
 third_party/libev/ev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/third_party/libev/ev.c b/third_party/libev/ev.c
index 4a94c8896b..a9a876039f 100644
--- a/third_party/libev/ev.c
+++ b/third_party/libev/ev.c
@@ -2294,7 +2294,7 @@ evpipe_init (EV_P)
   if (!ev_is_active (&pipe_w))
     {
 
-      if (evpipe [0] == -1)
+      if (evpipe [1] == -1)
         while (evpipe_alloc(loop) == -1)
           ev_syserr("(libev) error creating signal/async pipe");
       ev_io_set (&pipe_w, evpipe [0] < 0 ? evpipe [1] : evpipe [0], EV_READ);
-- 
GitLab