diff --git a/third_party/libev/ev.c b/third_party/libev/ev.c
index d33b55a7443adab703fcb5972835589b3f9c8fc3..4a94c8896b9ca8b278ceac42390f5387d3a711b3 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];