mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
Merge pull request #1561 from c-rack/issue-1558
Solution: check return code of make_fdpair() with zmq_assert
This commit is contained in:
commit
32d7da1103
@ -124,10 +124,11 @@ static int close_wait_ms (int fd_, unsigned int max_ms_ = 2000)
|
||||
zmq::signaler_t::signaler_t ()
|
||||
{
|
||||
// Create the socketpair for signaling.
|
||||
if (make_fdpair (&r, &w) == 0) {
|
||||
unblock_socket (w);
|
||||
unblock_socket (r);
|
||||
}
|
||||
int rc = make_fdpair (&r, &w);
|
||||
zmq_assert (rc == 0);
|
||||
|
||||
unblock_socket (w);
|
||||
unblock_socket (r);
|
||||
#ifdef HAVE_FORK
|
||||
pid = getpid ();
|
||||
#endif
|
||||
@ -321,7 +322,8 @@ void zmq::signaler_t::forked ()
|
||||
// Close file descriptors created in the parent and create new pair
|
||||
close (r);
|
||||
close (w);
|
||||
make_fdpair (&r, &w);
|
||||
int rc = make_fdpair (&r, &w);
|
||||
zmq_assert (rc == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user