From 863add50bfcb63793b739f6388c5358e829f6019 Mon Sep 17 00:00:00 2001 From: Frederik Seiffert Date: Fri, 20 Jan 2023 13:34:34 +0100 Subject: [PATCH] libdispatch: added patch to mostly work around possible crash when using NSURLSession More info: https://github.com/apple/swift-corelibs-libdispatch/pull/772 --- patches/libdispatch-fix-socket-closed.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/libdispatch-fix-socket-closed.patch diff --git a/patches/libdispatch-fix-socket-closed.patch b/patches/libdispatch-fix-socket-closed.patch new file mode 100644 index 0000000..df7b10b --- /dev/null +++ b/patches/libdispatch-fix-socket-closed.patch @@ -0,0 +1,19 @@ +https://github.com/apple/swift-corelibs-libdispatch/pull/772 +--- +diff --git a/src/event/event_windows.c b/src/event/event_windows.c +index 94674a3..148c9de 100644 +--- a/src/event/event_windows.c ++++ b/src/event/event_windows.c +@@ -219,7 +219,11 @@ _dispatch_muxnote_disarm_events(dispatch_muxnote_t dmn, + iResult = WSAEventSelect((SOCKET)dmn->dmn_ident, NULL, 0); + } + if (iResult != 0) { +- DISPATCH_INTERNAL_CRASH(WSAGetLastError(), "WSAEventSelect"); ++ // ignore error if socket was already closed ++ int err = WSAGetLastError(); ++ if (err != WSAENOTSOCK) { ++ DISPATCH_INTERNAL_CRASH(err, "WSAEventSelect"); ++ } + } + dmn->dmn_network_events = lNetworkEvents; + if (!lNetworkEvents && dmn->dmn_threadpool_wait) {