Commit 84560c16 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #405 from jimenezrick/master

Fix LIBZMQ-404: zmq_term not truly re-entrant
parents 631e12d4 92bee5a6
......@@ -173,6 +173,8 @@ int zmq_ctx_destroy (void *ctx_)
int rc = ((zmq::ctx_t*) ctx_)->terminate ();
int en = errno;
// Shut down only if termination was not interrupted by a signal.
if (!rc || en != EINTR) {
#ifdef ZMQ_HAVE_WINDOWS
// On Windows, uninitialise socket layer.
rc = WSACleanup ();
......@@ -184,6 +186,7 @@ int zmq_ctx_destroy (void *ctx_)
if (pgm_shutdown () != TRUE)
zmq_assert (false);
#endif
}
errno = en;
return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment