From 49d5bf5ebfe4a84070b7eac1e9d8ac52e1cc45fd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 09:15:41 -0300 Subject: A Save into a directory that is not there says no such directory, ENOENT It failed EIO with `file not found`, which named no file that was missing. It says `Save : no such directory`, and a late failure saying `no such` answers ENOENT, as a builtin's does. Co-Authored-By: Claude Opus 5.5 --- src/9p_io.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/9p_io.zig') diff --git a/src/9p_io.zig b/src/9p_io.zig index 2130db27..4c9c9bcf 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -315,7 +315,11 @@ pub const Listener = struct { // ponytail: one slot, so a failure of another client's effects that // settle in the same wait is told to this write too. if (l.core == core and core.fs.late_failure_len != 0) { - const failed = pardes.ctlfs.failText(req.tag, pardes.ctlfs.E.IO, core.fs.late_failure[0..core.fs.late_failure_len]); + const late = core.fs.late_failure[0..core.fs.late_failure_len]; + // What is not there (`no such directory`) is ENOENT, as a + // builtin's failure saying so is (ctl.failureErrno). + const errno = if (std.mem.indexOf(u8, late, "no such") != null) pardes.ctlfs.E.NOENT else pardes.ctlfs.E.IO; + const failed = pardes.ctlfs.failText(req.tag, errno, late); // Its err record says it (the path in it); the msg the failure // was also said as goes, as a builtin's failing a write does. pardes.ctlfs.events.dropMessage(core, core.fs.late_failure[0..core.fs.late_failure_len]); -- cgit v1.3