startup_checks: Use WaitForSingleObject and more cleanup
This commit is contained in:
parent
2d2a69ab5b
commit
7d9369d15e
1 changed files with 9 additions and 6 deletions
|
@ -58,13 +58,11 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait until the processs exits and get exit code from it
|
// Wait until the processs exits and get exit code from it
|
||||||
|
WaitForSingleObject(process_info.hProcess, INFINITE);
|
||||||
DWORD exit_code = STILL_ACTIVE;
|
DWORD exit_code = STILL_ACTIVE;
|
||||||
while (exit_code == STILL_ACTIVE) {
|
const int err = GetExitCodeProcess(process_info.hProcess, &exit_code);
|
||||||
const int err = GetExitCodeProcess(process_info.hProcess, &exit_code);
|
if (err == 0) {
|
||||||
if (err == 0) {
|
std::fprintf(stderr, "GetExitCodeProcess failed with error %d\n", GetLastError());
|
||||||
std::fprintf(stderr, "GetExitCodeProcess failed with error %d\n", GetLastError());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vulkan is broken if the child crashed (return value is not zero)
|
// Vulkan is broken if the child crashed (return value is not zero)
|
||||||
|
@ -77,6 +75,11 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
|
||||||
std::fprintf(stderr, "CloseHandle failed with error %d\n", GetLastError());
|
std::fprintf(stderr, "CloseHandle failed with error %d\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SetEnvironmentVariableA(STARTUP_CHECK_ENV_VAR, nullptr)) {
|
||||||
|
std::fprintf(stderr, "SetEnvironmentVariableA failed to clear %s with error %d\n",
|
||||||
|
STARTUP_CHECK_ENV_VAR, GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined(YUZU_UNIX)
|
#elif defined(YUZU_UNIX)
|
||||||
const pid_t pid = fork();
|
const pid_t pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
|
|
Loading…
Reference in a new issue