From 2b109f46408b55f6686458b50cc18d18564f7f94 Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Sat, 12 Sep 2020 06:14:28 +0700 Subject: [PATCH] Avoid getting Fatal signal 6 (SIGABRT) on linux/android when losing connectivity to the Adhoc Server. --- Core/HLE/proAdhoc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Core/HLE/proAdhoc.cpp b/Core/HLE/proAdhoc.cpp index 0bba246171..d3eae80ce3 100644 --- a/Core/HLE/proAdhoc.cpp +++ b/Core/HLE/proAdhoc.cpp @@ -230,6 +230,10 @@ int IsSocketReady(int fd, bool readfd, bool writefd, int* errorcode, int timeout fd_set readfds, writefds; timeval tval; + // Avoid getting Fatal signal 6 (SIGABRT) on linux/android + if (fd < 0) + return SOCKET_ERROR; + FD_ZERO(&readfds); writefds = readfds; if (readfd) {