mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-17 04:50:57 +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:
parent
6585aeaba2
commit
361e99a906
@ -156,6 +156,12 @@ zmq::stream_engine_t::~stream_engine_t ()
|
|||||||
wsa_assert (rc != SOCKET_ERROR);
|
wsa_assert (rc != SOCKET_ERROR);
|
||||||
#else
|
#else
|
||||||
int rc = close (s);
|
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);
|
errno_assert (rc == 0);
|
||||||
#endif
|
#endif
|
||||||
s = retired_fd;
|
s = retired_fd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user