Commit 54fe2541 authored by Dominik Charousset's avatar Dominik Charousset

Treat OpenBSD like Linux, i.e., use MSG_NOSIGNAL

parent 8114fae3
......@@ -92,24 +92,19 @@ namespace network {
const int ec_interrupted_syscall = EINTR;
#endif
// platform-dependent SIGPIPE setup
#if defined(CAF_MACOS) || defined(CAF_IOS) || defined(CAF_BSD)
// Use the socket option but no flags to recv/send on macOS/iOS/BSD.
// (OpenBSD doesn't have SO_NOSIGPIPE)
#ifndef __OpenBSD__
// Platform-dependent setup for supressing SIGPIPE.
#if defined(CAF_MACOS) || defined(CAF_IOS) || defined(__FreeBSD__)
// Set the SO_NOSIGPIPE socket option on macOS, iOS and FreeBSD.
const int no_sigpipe_socket_flag = SO_NOSIGPIPE;
#else
const int no_sigpipe_socket_flag = 0;
#endif
const int no_sigpipe_io_flag = 0;
#elif defined(CAF_WINDOWS)
// Do nothing on Windows (SIGPIPE does not exist).
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = 0;
// Do nothing on Windows (SIGPIPE does not exist).
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = 0;
#else
// Use flags to recv/send on Linux/Android but no socket option.
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = MSG_NOSIGNAL;
// Pass MSG_NOSIGNAL to recv/send on Linux/Android/OpenBSD.
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = MSG_NOSIGNAL;
#endif
#ifndef CAF_WINDOWS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment