summaryrefslogtreecommitdiffstats
path: root/unwind.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-31 22:51:37 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-31 22:51:37 -0700
commit0c7ef7145e687f1e7709f706365fd193ab33ef27 (patch)
tree343a761ed961400899dc07cd79a57bac8524c67e /unwind.c
parentaed4c55e415754df64073565e3b9c4979d033370 (diff)
downloadtxr-0c7ef7145e687f1e7709f706365fd193ab33ef27.tar.gz
txr-0c7ef7145e687f1e7709f706365fd193ab33ef27.tar.bz2
txr-0c7ef7145e687f1e7709f706365fd193ab33ef27.zip
Flush *stdout* upon unhandled exception.
* unwind.c (uw_unwind_to_exit_point): Prior to printing diagnostics related to an unhandled exception to std_error, flush std_output. This clarifies the output in situations when both std_error and std_output go to the same destination, and the exception occurred while producing output on std_output.
Diffstat (limited to 'unwind.c')
-rw-r--r--unwind.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index 6fc2720e..9377fdd3 100644
--- a/unwind.c
+++ b/unwind.c
@@ -112,6 +112,7 @@ static void uw_unwind_to_exit_point(void)
if (opt_loglevel >= 1) {
val prefix = format(nil, lit("~a:"), prog_string, nao);
+ flush_stream(std_output);
format(std_error, lit("~a unhandled exception of type ~a:\n"),
prefix, sym, nao);