Skip to content

Commit

Permalink
examples: Remove usage of boost::process::child::wait_for
Browse files Browse the repository at this point in the history
This method is marked deprecated in the Boost source (not, however, in
the Boost documentation) with no clear substitute. In this particular
case (we are using (`dd` to measure disk speed when running Linux in
`rx_samples_to_file`) we simply replace `wait_for` with an unconditional
`sleep_for`.
  • Loading branch information
mbr0wn authored and joergho committed Apr 2, 2024
1 parent 79335eb commit 23cb967
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions host/examples/rx_samples_to_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ double disk_rate_check(const size_t sample_type_size,
try {
boost::process::child c(
disk_check_proc_str, boost::process::std_err > pipe_stream);
if (!c.wait_for(std::chrono::duration<float>(1s))) {
kill(c.id(), SIGINT);
c.wait();
std::this_thread::sleep_for(std::chrono::seconds(1));
if (c.running()) {
c.terminate();
}
} catch (std::system_error& err) {
std::cerr << err_msg << std::endl;
Expand Down

0 comments on commit 23cb967

Please sign in to comment.