summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index fe1a707f..0cb7b960 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -865,8 +865,13 @@ fn armSocketCleanup() void {
}
}
+/// What else a fatal signal's handler removes (host_io's private prompt
+/// files); async-signal-safe.
+pub var fatal_cleanup: ?*const fn () void = null;
+
fn onFatalSignal(s: std.posix.SIG) callconv(.c) void {
unlinkOwnSocket();
+ if (fatal_cleanup) |cleanup| cleanup();
// SA_RESETHAND put the default back: the same signal, now fatal.
_ = std.c.raise(s);
}