Problem: in case of exhausted resources on creation of a context, assertions are triggered

Solution: signal error to caller, and apply appropriate cleanup
This commit is contained in:
sigiesec
2018-01-31 17:03:29 +01:00
committed by Giesecke
parent 4e2b9e6e07
commit 206c832167
12 changed files with 146 additions and 49 deletions

View File

@@ -372,6 +372,11 @@ int zmq::signaler_t::recv_failable ()
return 0;
}
bool zmq::signaler_t::valid () const
{
return w != retired_fd;
}
#ifdef HAVE_FORK
void zmq::signaler_t::forked ()
{
@@ -398,7 +403,7 @@ int zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
errno_assert (errno == ENFILE || errno == EMFILE);
*w_ = *r_ = -1;
return -1;
}
}
else {
*w_ = *r_ = fd;
return 0;