diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 09:58:15 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 10:36:27 -0300 |
| commit | 70881bb4edd15fe918ee5fed4ed3e8922bc7fc6a (patch) | |
| tree | 18d80a3172d054cd152f78f56d82150f914b81f2 /src/ninep/tree.zig | |
| parent | caa8ed077e8b9b67d18f18b3ec46891bd8d310a7 (diff) | |
| download | pardes-70881bb4edd15fe918ee5fed4ed3e8922bc7fc6a.tar.gz pardes-70881bb4edd15fe918ee5fed4ed3e8922bc7fc6a.zip | |
A command or terminal pane refused for room is refused before anything is logged or answered of it, and a serial is never handed out twice
A command pane with no room logged `new N` and `run N ls`, was answered
to its exec, then went with `del N` and no `exit N`; and sync gave N
back (`next_serial -= 1`) to the next pane made, so a script holding N
found another pane under it. Tty did the same. Both now take a refused
placement back at once, before the run is logged or the serial answered
(the pane was never announced, so it leaves no record), and fail the
write with no room. The decrement is gone: gaps are fine, and a serial
once said names one pane for good.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index e6c139c1..40543ecf 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -1905,10 +1905,11 @@ test "no placement leaves a pane shorter than its tag and two rows; a full colum } else return error.NeverRefused; try testing.expectEqual(E.NOSPC, refused.errno()); try testing.expect(std.mem.indexOf(u8, refused.reply.ename, "no space for a pane in that column") != null); - // The refused pane was never there: no serial spent on it. + // The refused pane was never there; its serial is not handed out again + // (gaps are fine: a serial once said names one pane for good). const before = p.next_serial; try testing.expectEqual(E.NOSPC, call(p, .{ .tag = 1, .op = .open, .node = new }).errno()); - try testing.expectEqual(before, p.next_serial); + try testing.expectEqual(before + 1, p.next_serial); p.sync(); var count: usize = 0; for (p.panes) |slot| count += @intFromBool(slot != null); |
