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