Skip to content

Commit 863add5

Browse files
committed
libdispatch: added patch to mostly work around possible crash when using NSURLSession
More info: swiftlang/swift-corelibs-libdispatch#772
1 parent c2f2cc4 commit 863add5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Diff for: patches/libdispatch-fix-socket-closed.patch

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
https://github.com/apple/swift-corelibs-libdispatch/pull/772
2+
---
3+
diff --git a/src/event/event_windows.c b/src/event/event_windows.c
4+
index 94674a3..148c9de 100644
5+
--- a/src/event/event_windows.c
6+
+++ b/src/event/event_windows.c
7+
@@ -219,7 +219,11 @@ _dispatch_muxnote_disarm_events(dispatch_muxnote_t dmn,
8+
iResult = WSAEventSelect((SOCKET)dmn->dmn_ident, NULL, 0);
9+
}
10+
if (iResult != 0) {
11+
- DISPATCH_INTERNAL_CRASH(WSAGetLastError(), "WSAEventSelect");
12+
+ // ignore error if socket was already closed
13+
+ int err = WSAGetLastError();
14+
+ if (err != WSAENOTSOCK) {
15+
+ DISPATCH_INTERNAL_CRASH(err, "WSAEventSelect");
16+
+ }
17+
}
18+
dmn->dmn_network_events = lNetworkEvents;
19+
if (!lNetworkEvents && dmn->dmn_threadpool_wait) {

0 commit comments

Comments
 (0)