diff options
Diffstat (limited to 'src/lib/grok/util.cc')
| -rw-r--r-- | src/lib/grok/util.cc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/grok/util.cc b/src/lib/grok/util.cc index 33847e8bb..a8ac9943d 100644 --- a/src/lib/grok/util.cc +++ b/src/lib/grok/util.cc @@ -64,28 +64,28 @@ get_gpu_names() namespace bp = boost::process::v2; try { - boost::asio::io_context context; - boost::asio::readable_pipe out{context}; - bp::process child(context, binary, {}, bp::process_stdio{{}, out, {}}); - - string output; - boost::system::error_code ec; - while (child.running()) { - string block; - boost::asio::read(out, boost::asio::dynamic_buffer(block), ec); - output += block; - if (ec && ec == boost::asio::error::eof) { - break; - } - } - - vector<string> lines; - boost::algorithm::split(lines, output, boost::is_any_of("\n")); - return lines; - } catch (std::exception& e) { + boost::asio::io_context context; + boost::asio::readable_pipe out{context}; + bp::process child(context, binary, {}, bp::process_stdio{{}, out, {}}); + + string output; + boost::system::error_code ec; + while (child.running()) { + string block; + boost::asio::read(out, boost::asio::dynamic_buffer(block), ec); + output += block; + if (ec && ec == boost::asio::error::eof) { + break; + } + } + + vector<string> lines; + boost::algorithm::split(lines, output, boost::is_any_of("\n")); + return lines; + } catch (std::exception& e) { LOG_ERROR("Could not fetch GPU names: {}", e.what()); return {}; - } + } #endif } |
