summaryrefslogtreecommitdiff
path: root/src/macos.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 23:13:57 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit90530f893236c665deb9f5bddc925ee1fe51cca5 (patch)
treef9fb5a34731eab09fddae5751d3cc8450c796853 /src/macos.zig
parent8b2a55f31169ede82e11a573ab655e72e7831fe7 (diff)
downloadpardes-90530f893236c665deb9f5bddc925ee1fe51cca5.tar.gz
pardes-90530f893236c665deb9f5bddc925ee1fe51cca5.zip
A failed Dump or a Restore of no dump fails its write, before any warning
A Dump into a DumpDir it could not write, or a Restore of a file that is not a dump, answered a ctl write with rc 0 and only a message, and the Restore warned about unsaved panes before it ever looked at the file. The hosts' dump write now fails the waiting 9P write with EIO (the late failure a Save uses), naming the path and the reason in the log, and Restore parses the file before its unsaved-panes refusal, failing with `not a pardes dump`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/macos.zig')
-rw-r--r--src/macos.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/macos.zig b/src/macos.zig
index 678b155d..d6daf944 100644
--- a/src/macos.zig
+++ b/src/macos.zig
@@ -2496,8 +2496,8 @@ fn writeFile(ctx: ?*anyopaque, pane: u8, path: []const u8, bytes: []const u8) vo
fn writeDump(ctx: ?*anyopaque, bytes: []const u8) void {
const st = hostState(ctx);
var pbuf: [1024:0]u8 = undefined;
- const path = pardes.dump.outPath(&pbuf, st.core.settings.dump_dir.get()) orelse return;
- filesystem.write(st.core, path, bytes) catch |err| return st.core.reportError(0, "dump", err);
+ const path = pardes.dump.outPath(&pbuf, st.core.settings.dump_dir.get()) orelse return st.core.dumpFailed(st.core.settings.dump_dir.get(), error.NoDumpDirectory);
+ filesystem.write(st.core, path, bytes) catch |err| return st.core.dumpFailed(path, err);
st.core.setLastDump(path);
}