diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-24 16:39:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-18 13:46:50 +0200 |
| commit | 114a4a1a3056aa077b7734887fbcbff107d80a51 (patch) | |
| tree | 3259bba8ae29649b13574e2d1a267c73dbf61ba2 /src | |
| parent | ff240aa07b9ba3c07abb45ec349df9acd0bffc57 (diff) | |
Check for errors when calling the GPU lister.
Diffstat (limited to 'src')
| -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); |
