about summary refs log tree commit diff stats
path: root/020run.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-12-05 01:15:10 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-12-05 01:15:10 -0800
commitd51abbf123f2411624b8c849f72624f1c70c4224 (patch)
tree059e03aa80e74df2d2033870bc892e7d641c579a /020run.cc
parent26b4bdc8b3b1d1f2f4b4dae1e7d2b89c7e286b1b (diff)
downloadmu-d51abbf123f2411624b8c849f72624f1c70c4224.tar.gz
4139
Diffstat (limited to '020run.cc')
-rw-r--r--020run.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/020run.cc b/020run.cc
index b94d274a..4d151b93 100644
--- a/020run.cc
+++ b/020run.cc
@@ -233,13 +233,11 @@ else if (is_equal(*arg, "--trace")) {
 
 :(code)
 void cleanup_main() {
-  if (Save_trace && Trace_stream) {
-    cerr << "writing trace to 'last_run'\n";
-    ofstream fout("last_run");
-    fout << Trace_stream->readable_contents("");
-    fout.close();
-  }
-  if (Trace_stream) delete Trace_stream, Trace_stream = NULL;
+  if (!Trace_stream) return;
+  if (Save_trace);
+    Trace_stream->dump();
+  delete Trace_stream;
+  Trace_stream = NULL;
 }
 :(before "End One-time Setup")
 atexit(cleanup_main);