1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-06 09:39:49 +00:00

Make sure function handling crash does not return

This commit is contained in:
elsid 2024-01-19 14:13:47 +01:00
parent fffc6101b7
commit 2ef286b27a
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -305,7 +305,7 @@ static void crash_catcher(int signum, siginfo_t* siginfo, void* /*context*/)
} }
} }
static void crash_handler(const char* logfile) [[noreturn]] static void handleCrash(const char* logfile)
{ {
if (fread(&crash_info, sizeof(crash_info), 1, stdin) != 1) if (fread(&crash_info, sizeof(crash_info), 1, stdin) != 1)
{ {
@ -504,7 +504,7 @@ void crashCatcherInstall(int argc, char** argv, const std::filesystem::path& cra
#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \ #if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) \
|| defined(__posix)) || defined(__posix))
if (argc == 2 && strcmp(argv[1], crash_switch) == 0) if (argc == 2 && strcmp(argv[1], crash_switch) == 0)
crash_handler(Files::pathToUnicodeString(crashLogPath).c_str()); handleCrash(Files::pathToUnicodeString(crashLogPath).c_str());
if (is_debugger_present()) if (is_debugger_present())
return; return;