From 2db608975cdecc1df556addd9b4667f4465c91db Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tsisyk.com>
Date: Thu, 4 Feb 2016 18:31:54 +0300
Subject: [PATCH] gh-1094: fix evpipe_alloc() logic

---
 third_party/libev/ev.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/third_party/libev/ev.c b/third_party/libev/ev.c
index d33b55a744..4a94c8896b 100644
--- a/third_party/libev/ev.c
+++ b/third_party/libev/ev.c
@@ -2263,11 +2263,10 @@ static int evpipe_alloc(EV_P)
   if (fds [1] < 0)
 # endif
     {
-      if (!pipe (fds))
-         fd_intern (fds [0]);
+      if (pipe(fds))
+         return -1;
+      fd_intern (fds [0]);
     }
-  if (fds [1] < 0)
-    return -1;
 
   evpipe [0] = fds [0];
 
-- 
GitLab