From 114a4a1a3056aa077b7734887fbcbff107d80a51 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 24 Sep 2023 16:39:27 +0200 Subject: [PATCH] Check for errors when calling the GPU lister. --- src/wx/grok/gpu_config_panel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wx/grok/gpu_config_panel.h b/src/wx/grok/gpu_config_panel.h index 1478434be..2647c1ece 100644 --- a/src/wx/grok/gpu_config_panel.h +++ b/src/wx/grok/gpu_config_panel.h @@ -3,7 +3,9 @@ static std::vector get_gpu_names(std::string binary, std::string filename) { // Execute the GPU listing program and redirect its output to a file - std::system((binary + " > " + filename).c_str()); + if (std::system((binary + " > " + filename).c_str()) < 0) { + return {}; + } std::vector gpu_names; std::ifstream file(filename); -- 2.30.2