From 5dad00ebdcf692cf8275c4a7e0d2d194bd1ac280 Mon Sep 17 00:00:00 2001 From: Constantin Rack Date: Thu, 3 Sep 2015 12:31:55 +0200 Subject: [PATCH] Problem: do not call poller->add_fd() with -1. Fixes #1558 --- src/reaper.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/reaper.cpp b/src/reaper.cpp index 2de9dbc1..11d49f65 100644 --- a/src/reaper.cpp +++ b/src/reaper.cpp @@ -40,8 +40,10 @@ zmq::reaper_t::reaper_t (class ctx_t *ctx_, uint32_t tid_) : poller = new (std::nothrow) poller_t (*ctx_); alloc_assert (poller); - mailbox_handle = poller->add_fd (mailbox.get_fd (), this); - poller->set_pollin (mailbox_handle); + if (mailbox.get_fd () != retired_fd) { + mailbox_handle = poller->add_fd (mailbox.get_fd (), this); + poller->set_pollin (mailbox_handle); + } #ifdef HAVE_FORK pid = getpid();