From d01373c03c135c0882c49c8bf95006d32fef041c Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 27 Nov 2024 10:10:18 +0100 Subject: [PATCH] Enable close-on-interrupt for macOS This behavior is also necessary on macOS. Fixes #5536 --- app/src/util/net.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/util/net.h b/app/src/util/net.h index 9f23bac9c8..94789954ad 100644 --- a/app/src/util/net.h +++ b/app/src/util/net.h @@ -16,10 +16,10 @@ # define SC_RAW_SOCKET_NONE -1 #endif -#ifdef _WIN32 -// On Windows, shutdown() does not interrupt accept() or read() calls, so -// net_interrupt() must call close() instead, and net_close() must behave -// accordingly. +#if defined(_WIN32) || defined(__APPLE__) +// On Windows and macOS, shutdown() does not interrupt accept() or read() +// calls, so net_interrupt() must call close() instead, and net_close() must +// behave accordingly. // This causes a small race condition (once the socket is closed, its // handle becomes invalid and may in theory be reassigned before another // thread calls accept() or read()), but it is deemed acceptable as a