about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--kaagum/trace.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/kaagum/trace.scm b/kaagum/trace.scm
index 2c2c4ed..80e0f81 100644
--- a/kaagum/trace.scm
+++ b/kaagum/trace.scm
@@ -29,4 +29,8 @@
     (display subsystem (%trace-port))
     (display ": " (%trace-port))
     (apply format (%trace-port) message args)
-    (newline (%trace-port))))
+    (newline (%trace-port))
+    ;; fsync the trace port to ensure that the trace is written to disk; just
+    ;; preparing for the worst-case scenario where kaagum crashes or is killed
+    ;; before the trace can reach the disk.
+    (fsync (%trace-port))))