From 8157972cff633ee0135c81fd3f1195d9a73eb92f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 08:20:20 -0300 Subject: A builtin failure over something not there answers ENOENT: Unmount of a name not mounted `Unmount nothere` failed EIO with `not mounted`. It says `no such mount nothere` now, and a builtin's failure that says `no such` (this, Tty's `no such directory`) answers ENOENT, the errno 9ns reads from those words. Co-Authored-By: Claude Opus 5.5 --- src/builtins.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index 59fc140d..095eadbd 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -705,7 +705,14 @@ pub const Unmount = struct { var args = std.mem.tokenizeAny(u8, c.arg orelse "", " \t"); const name = args.next() orelse return c.p.reportError(c.id, "Unmount name", error.MissingArgument); if (args.next() != null) return c.p.reportError(c.id, "Unmount name", error.TooManyArguments); - pardes.filesystem.unmount(c.p, name) catch |err| return c.p.reportError(c.id, "Unmount", err); + pardes.filesystem.unmount(c.p, name) catch |err| { + // "no such": the words 9ns reads as ENOENT. + if (err == error.NotMounted) { + var said: [96]u8 = undefined; + return c.p.reportFailure(c.id, std.fmt.bufPrint(&said, "Unmount: no such mount {s}", .{name[0..@min(name.len, 32)]}) catch "Unmount: no such mount"); + } + return c.p.reportError(c.id, "Unmount", err); + }; } }; -- cgit v1.3