From e3be3b2c122800c743b33bc45697d3a477621f6d Mon Sep 17 00:00:00 2001 From: stickz Date: Thu, 5 Dec 2024 13:47:33 -0500 Subject: [PATCH] scgi: Fix Apple and Solaris compatibility This is a follow up to #1310. Apple and Solaris do not support MSG_NOSIGNAL, so disable this flag for these platforms until we find a better solution. Other platforms remain unaffected. --- src/rpc/scgi_task.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpc/scgi_task.cc b/src/rpc/scgi_task.cc index 160ba508..c0a464b6 100644 --- a/src/rpc/scgi_task.cc +++ b/src/rpc/scgi_task.cc @@ -200,7 +200,13 @@ SCgiTask::event_read() { void SCgiTask::event_write() { +// Apple and Solaris do not support MSG_NOSIGNAL, +// so disable this fix until we find a better solution +#if defined(__APPLE__) || defined(__sun__) + int bytes = ::send(m_fileDesc, m_position, m_bufferSize, 0); +#else int bytes = ::send(m_fileDesc, m_position, m_bufferSize, MSG_NOSIGNAL); +#endif if (bytes == -1) { if (!rak::error_number::current().is_blocked_momentary())