diff --git a/src/uFrontNMEABridge/Socket.cpp b/src/uFrontNMEABridge/Socket.cpp index 6514b0e..74cf46e 100644 --- a/src/uFrontNMEABridge/Socket.cpp +++ b/src/uFrontNMEABridge/Socket.cpp @@ -26,12 +26,8 @@ bool Socket::create() { return false; } - int on = 1; - #if defined(SO_NOSIGPIPE) - setsockopt(m_sock, SOL_SOCKET, SO_NOSIGPIPE, (const char *) &on, sizeof(on)); - #endif - // TIME_WAIT - argh + int on = 1; return setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on)) != -1; } diff --git a/src/uFrontNMEABridge/Socket.h b/src/uFrontNMEABridge/Socket.h index b68a113..ce0968c 100644 --- a/src/uFrontNMEABridge/Socket.h +++ b/src/uFrontNMEABridge/Socket.h @@ -6,9 +6,9 @@ #ifndef Socket_HEADER #define Socket_HEADER -// MacOS doesn't have MSG_NOSIGNAL, default to 0 / nothing +// MacOS doesn't have MSG_NOSIGNAL, explicitly declare it #if defined(__APPLE__) && !defined(MSG_NOSIGNAL) -#define MSG_NOSIGNAL 0 +#define MSG_NOSIGNAL 0x2000 #endif