diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-24 16:39:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-29 21:19:56 +0100 |
| commit | 1e1acbc8487a06de5e35a14742ea82f7afa8e2e3 (patch) | |
| tree | bdfdd57cea6ec0c7bcb3f7ba4d0f1e67c17b47da | |
| parent | 7a95493bd2e6348135dbdbd4297af7971584742f (diff) | |
Check for errors when calling the GPU lister.
| -rw-r--r-- | src/wx/grok/gpu_config_panel.h | 4 |
1 files changed, 3 insertions, 1 deletions
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<std::string> 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<std::string> gpu_names; std::ifstream file(filename); |
