From f06645c5f16c27baed186369ebf03eac252e3850 Mon Sep 17 00:00:00 2001 From: Matt Connolly Date: Sun, 10 Nov 2013 21:16:12 +1000 Subject: [PATCH] Update signaler make_fdpair to set file descriptors to -1 when too many files are open using socketpair. --- src/signaler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/signaler.cpp b/src/signaler.cpp index 4b13329b..cc6c1a63 100644 --- a/src/signaler.cpp +++ b/src/signaler.cpp @@ -474,7 +474,7 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_) int rc = socketpair (AF_UNIX, SOCK_STREAM, 0, sv); if (rc == -1) { errno_assert (errno == ENFILE || errno == EMFILE); - sv [0] = sv [1] = -1; + *w_ = *r_ = -1; return -1; } else {