diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-08-17 23:14:37 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-08-20 17:37:44 +0300 |
commit | 41f958c4cf68541a48b20ceb608afe2308a6e6a7 (patch) | |
tree | c4e92865e98b7a3b911d355525e984151b44da22 /tests | |
parent | c00321b94d6b952d59257b4a7373a1199e874d98 (diff) |
Add timed_wait() and kill() to process class, change try_wait() signature
Review
Backup
Diffstat (limited to 'tests')
-rw-r--r-- | tests/process/driver.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/process/driver.cxx b/tests/process/driver.cxx index 6ca28a5..18017a7 100644 --- a/tests/process/driver.cxx +++ b/tests/process/driver.cxx @@ -49,6 +49,7 @@ exec (const path& p, bool env = false) // Set environment variables for the child. { using cstrings = vector<const char*>; + using butl::optional; assert (!in.empty () || (!out && !err)); // Nothing to output if no input. assert (!pipeline || out); // To pipeline need to output something. @@ -95,8 +96,7 @@ exec (const path& p, { if (!in.empty ()) { - bool s; - r = !pr.try_wait (s); // Couldn't exit as waiting for the input. + r = !pr.try_wait (); // Couldn't exit as waiting for the input. auto bin_mode = [bin](auto_fd fd) -> auto_fd { @@ -170,8 +170,8 @@ exec (const path& p, r = false; } - bool s; - return pr.wait () && pr.try_wait (s) && s && r; + optional<bool> s; + return pr.wait () && (s = pr.try_wait ()) && *s && r; } catch (const process_error& e) { |