aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-16 17:42:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-16 17:42:12 +0200
commitae5cab7489fe014dd3aa818cf2655d7a4714af83 (patch)
treea80fdc22ce5909b98bd58292aaf8e2bc28e70492 /build2/cc/link.cxx
parent530e8914ba00ce0e7ee89ba30d2b88f2c09f43c9 (diff)
Improve process execution diagnostics by reusing run_*() API
Diffstat (limited to 'build2/cc/link.cxx')
-rw-r--r--build2/cc/link.cxx25
1 files changed, 4 insertions, 21 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx
index c0ff10c..f69d549 100644
--- a/build2/cc/link.cxx
+++ b/build2/cc/link.cxx
@@ -1297,9 +1297,6 @@ namespace build2
os << "\"" << endl;
os.close ();
-
- if (!pr.wait ())
- throw failed (); // Assume diagnostics issued.
}
catch (const io_error& e)
{
@@ -1307,6 +1304,8 @@ namespace build2
fail << "unable to pipe resource file to " << args[0]
<< ": " << e;
}
+
+ run_finish (args, pr);
}
catch (const process_error& e)
{
@@ -1963,8 +1962,7 @@ namespace build2
catch (const io_error&) {} // Assume exits with error.
}
- if (!pr.wait ())
- throw failed ();
+ run_finish (args, pr);
}
catch (const process_error& e)
{
@@ -1997,22 +1995,7 @@ namespace build2
if (verb >= 2)
print_process (args);
- try
- {
- process pr (rl, args);
-
- if (!pr.wait ())
- throw failed ();
- }
- catch (const process_error& e)
- {
- error << "unable to execute " << args[0] << ": " << e;
-
- if (e.child)
- exit (1);
-
- throw failed ();
- }
+ run (rl, args);
}
if (tclass == "windows")