0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 08:39:42 +08:00

Problem: kFreeBSD might return ECONNRESET under load when destroying engine

Solution: ignore it on kFreeBSD, as it is not an error
Thanks Steven Chamberlain <steven@pyro.eu.org> for the patch!
This commit is contained in:
Luca Boccassi 2016-11-05 18:12:01 +00:00
parent 6585aeaba2
commit 361e99a906

View File

@ -156,6 +156,12 @@ zmq::stream_engine_t::~stream_engine_t ()
wsa_assert (rc != SOCKET_ERROR);
#else
int rc = close (s);
#ifdef __FreeBSD_kernel__
// FreeBSD may return ECONNRESET on close() under load but this is not
// an error.
if (rc == -1 && errno == ECONNRESET)
rc = 0;
#endif
errno_assert (rc == 0);
#endif
s = retired_fd;