summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlat9nq <lat9nq@gmail.com>2022-07-12 20:23:50 +0200
committerlat9nq <lat9nq@gmail.com>2022-07-12 20:23:50 +0200
commit7d9369d15ea6061e4b3a48cc8dbe442501a86ba1 (patch)
tree0ad12494524dc0fe81a7ed4a022ddda361bb7f4b /src
parentstartup_checks: Use GetEnvironmentVariableA (diff)
downloadyuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar.gz
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar.bz2
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar.lz
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar.xz
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.tar.zst
yuzu-7d9369d15ea6061e4b3a48cc8dbe442501a86ba1.zip
Diffstat (limited to '')
-rw-r--r--src/yuzu/startup_checks.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/yuzu/startup_checks.cpp b/src/yuzu/startup_checks.cpp
index 0919d89c6..8421280bf 100644
--- a/src/yuzu/startup_checks.cpp
+++ b/src/yuzu/startup_checks.cpp
@@ -58,13 +58,11 @@ bool StartupChecks(const char* arg0, bool* has_broken_vulkan) {
}
// Wait until the processs exits and get exit code from it
+ WaitForSingleObject(process_info.hProcess, INFINITE);
DWORD exit_code = STILL_ACTIVE;
- while (exit_code == STILL_ACTIVE) {
- const int err = GetExitCodeProcess(process_info.hProcess, &exit_code);
- if (err == 0) {
- std::fprintf(stderr, "GetExitCodeProcess failed with error %d\n", GetLastError());
- break;
- }
+ const int err = GetExitCodeProcess(process_info.hProcess, &exit_code);
+ if (err == 0) {
+ std::fprintf(stderr, "GetExitCodeProcess failed with error %d\n", GetLastError());
}
// 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());
}
+ 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)
const pid_t pid = fork();
if (pid == 0) {