Problem: return code of make_fdpair() is not checked. Fixes #1558

This commit is contained in:
Constantin Rack 2015-09-02 23:18:54 +02:00
parent 801f39dbef
commit bb9788867f

View File

@ -124,10 +124,11 @@ static int close_wait_ms (int fd_, unsigned int max_ms_ = 2000)
zmq::signaler_t::signaler_t () zmq::signaler_t::signaler_t ()
{ {
// Create the socketpair for signaling. // Create the socketpair for signaling.
if (make_fdpair (&r, &w) == 0) { int rc = make_fdpair (&r, &w);
zmq_assert (rc == 0);
unblock_socket (w); unblock_socket (w);
unblock_socket (r); unblock_socket (r);
}
#ifdef HAVE_FORK #ifdef HAVE_FORK
pid = getpid (); pid = getpid ();
#endif #endif
@ -321,7 +322,8 @@ void zmq::signaler_t::forked ()
// Close file descriptors created in the parent and create new pair // Close file descriptors created in the parent and create new pair
close (r); close (r);
close (w); close (w);
make_fdpair (&r, &w); int rc = make_fdpair (&r, &w);
zmq_assert (rc == 0);
} }
#endif #endif