diff --git a/src/stream_engine.cpp b/src/stream_engine.cpp index 8d2de8e5c3..2e57ec3c87 100644 --- a/src/stream_engine.cpp +++ b/src/stream_engine.cpp @@ -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; diff --git a/src/thread.cpp b/src/thread.cpp index 2c044a499c..f5e1165e7a 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -145,6 +145,12 @@ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_ #endif rc = pthread_setschedparam(descriptor, policy, ¶m); + +#ifdef __FreeBSD_kernel__ + // If this feature is unavailable at run-time, don't abort. + if(rc == ENOSYS) return; +#endif + posix_assert (rc); #else