aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/utility.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-27 08:37:56 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-27 08:39:31 +0200
commit1abc10223b37d9ead3454a06e176b4b65370a2be (patch)
tree2d30c9130bb7acf2968078ed408e1d36b70c22b0 /libbuild2/utility.txx
parentba637925b32e85c22c9dc81820e407ebdacfe5f7 (diff)
Improve process run_*() API
Diffstat (limited to 'libbuild2/utility.txx')
-rw-r--r--libbuild2/utility.txx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbuild2/utility.txx b/libbuild2/utility.txx
index c183930..aadb181 100644
--- a/libbuild2/utility.txx
+++ b/libbuild2/utility.txx
@@ -56,6 +56,9 @@ namespace build2
return p;
}
+ [[noreturn]] LIBBUILD2_SYMEXPORT void
+ run_io_error (const char*[], const io_error&);
+
template <typename T, typename F>
T
run (uint16_t verbosity,
@@ -102,12 +105,16 @@ namespace build2
is.close ();
}
- catch (const io_error&)
+ catch (const io_error& e)
{
- // Presumably the child process failed. Let run_finish() deal with that.
+ if (run_wait (args, pr))
+ run_io_error (args, e);
+
+ // If the child process has failed then assume the io error was
+ // caused by that and let run_finish() deal with it.
}
- if (!(run_finish (args, pr, err, l) || ignore_exit))
+ if (!(run_finish_impl (args, pr, err, l) || ignore_exit))
r = T ();
return r;