From 41f958c4cf68541a48b20ceb608afe2308a6e6a7 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 17 Aug 2018 23:14:37 +0300 Subject: Add timed_wait() and kill() to process class, change try_wait() signature Review Backup --- tests/process/driver.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') 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; + 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 s; + return pr.wait () && (s = pr.try_wait ()) && *s && r; } catch (const process_error& e) { -- cgit v1.1