summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-24 16:39:27 +0200
committerCarl Hetherington <cth@carlh.net>2024-01-28 02:01:57 +0100
commit6d9136e9cc373751958f031d00b50320027055f4 (patch)
tree9ea0d2f9dd323cfe6a0a0c5560214b7b15a3e8cf
parent38f32bfbfafcb29d6b3dbc9dd8c24dc474de32ec (diff)
Check for errors when calling the GPU lister.
-rw-r--r--src/wx/grok/gpu_config_panel.h4
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);