From 9fa0969549108bcdf05201e846226470e278a798 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:16:21 -0300 Subject: addr reads empty after a failed address instead of failing With no address after a failed write, a read of addr itself failed (EIO through a mount), which reads as a broken file rather than as no address. It now reads empty, as an unset limit does; data and xdata still refuse. Co-Authored-By: Claude Opus 5.5 --- src/ninep/addr.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ninep/addr.zig') diff --git a/src/ninep/addr.zig b/src/ninep/addr.zig index e731ba24..15f23a55 100644 --- a/src/ninep/addr.zig +++ b/src/ninep/addr.zig @@ -373,7 +373,8 @@ test "a failed address leaves none, so data refuses rather than act at the last try testing.expectEqualStrings(e_no_match, th.wr(p, addr, "/zzz/").reply.ename); try testing.expectEqualStrings(pane_files.e_addr_failed, th.wr(p, data, "ONE").reply.ename); try testing.expectEqualStrings(pane_files.e_addr_failed, th.rd(p, data, 0, 64).reply.ename); - try testing.expectEqualStrings(pane_files.e_addr_failed, th.rd(p, addr, 0, 64).reply.ename); + try testing.expectEqual(Status.ok, th.rd(p, addr, 0, 64).reply.status); + try testing.expectEqualStrings("", th.rd(p, addr, 0, 64).bytes); try testing.expectEqual(E.INVAL, th.call(p, .{ .tag = 1, .op = .setattr, .node = Node.of(serial, .xdata), .truncate = true }).errno()); try testing.expectEqualStrings("one\ntwo\n", p.panes[0].?.file.?.content); // A good address gives it one again; truncating addr does not. -- cgit v1.3