aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile.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/compile.cxx
parent530e8914ba00ce0e7ee89ba30d2b88f2c09f43c9 (diff)
Improve process execution diagnostics by reusing run_*() API
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r--build2/cc/compile.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx
index d73e67c..3b60a5b 100644
--- a/build2/cc/compile.cxx
+++ b/build2/cc/compile.cxx
@@ -2723,7 +2723,7 @@ namespace build2
continue;
}
else
- fail << args[0] << " terminated abnormally: " << e.description ();
+ run_finish (args, pr); // Throws.
}
catch (const process_error& e)
{
@@ -3012,7 +3012,7 @@ namespace build2
info << "then run failing command to display compiler diagnostics";
}
else
- fail << args[0] << " terminated abnormally: " << e.description ();
+ run_finish (args, pr); // Throws.
}
catch (const process_error& e)
{
@@ -4489,17 +4489,12 @@ namespace build2
catch (const io_error&) {} // Assume exits with error.
}
- if (!pr.wait ())
- throw failed ();
+ run_finish (args, pr);
}
catch (const process_error& e)
{
error << "unable to execute " << args[0] << ": " << e;
- // In a multi-threaded program that fork()'ed but did not exec(),
- // it is unwise to try to do any kind of cleanup (like unwinding
- // the stack and running destructors).
- //
if (e.child)
exit (1);
@@ -4541,8 +4536,7 @@ namespace build2
nullptr, // CWD
env.empty () ? nullptr : env.data ());
- if (!pr.wait ())
- throw failed ();
+ run_finish (args, pr);
}
catch (const process_error& e)
{