diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 02:16:21 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 9fa0969549108bcdf05201e846226470e278a798 (patch) | |
| tree | ff5f4e6f55f8968d3e51f7bbf2e0602b78e3bb89 /src/ninep/addr.zig | |
| parent | 9391d35d357ebf18759c10f6c756855e5a8f7b50 (diff) | |
| download | pardes-9fa0969549108bcdf05201e846226470e278a798.tar.gz pardes-9fa0969549108bcdf05201e846226470e278a798.zip | |
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 <[email protected]>
Diffstat (limited to 'src/ninep/addr.zig')
| -rw-r--r-- | src/ninep/addr.zig | 3 |
1 files changed, 2 insertions, 1 deletions
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. |
