about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArun Isaac2026-08-06 01:04:02 +0100
committerArun Isaac2026-08-06 01:04:02 +0100
commit092ca7ab12bd0cc2dee1721d84d78a61d75d4aca (patch)
treec950d256e49e630861f045a93b9ea75da9e24062
parentf8b0bafa4064656624c06ad262ce87cd37cb7965 (diff)
downloadkaagum-092ca7ab12bd0cc2dee1721d84d78a61d75d4aca.tar.gz
kaagum-092ca7ab12bd0cc2dee1721d84d78a61d75d4aca.tar.lz
kaagum-092ca7ab12bd0cc2dee1721d84d78a61d75d4aca.zip
trace: fsync immediately.
-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))))