add __FreeBSD__ to ifdefs

On FreeBSD the sysmbol __FreeBSD_kernel__ is only defines if a
specific param.h file is included, unlike Debian/kFreeBSD where this
symbol is always defined.  So also compile the FreeBSD specific code
if __FreeBSD__ is defined for FreeBSD 11 & 12 compatibility.

Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>
This commit is contained in:
Christopher Hall 2017-10-03 15:30:42 +08:00
parent 44f96a3652
commit 997825bdf1
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ zmq::stream_engine_t::~stream_engine_t ()
wsa_assert (rc != SOCKET_ERROR);
#else
int rc = close (s);
#ifdef __FreeBSD_kernel__
#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__)
// FreeBSD may return ECONNRESET on close() under load but this is not
// an error.
if (rc == -1 && errno == ECONNRESET)

View File

@ -152,7 +152,7 @@ void zmq::thread_t::setSchedulingParameters(int priority_, int schedulingPolicy_
rc = pthread_setschedparam(descriptor, policy, &param);
#ifdef __FreeBSD_kernel__
#if defined(__FreeBSD_kernel__) || defined (__FreeBSD__)
// If this feature is unavailable at run-time, don't abort.
if(rc == ENOSYS) return;
#endif