diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 20:14:04 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | acd9e032a147f4aa7ad49110dc2f4fb945e7a9bb (patch) | |
| tree | 6b81d7ac0b759472bd5c1afb1fc15cd6c930ac79 /src/ninep/tree.zig | |
| parent | 28c814aa5cfea23e8950ef007916ffc5d089288d (diff) | |
| download | pardes-acd9e032a147f4aa7ad49110dc2f4fb945e7a9bb.tar.gz pardes-acd9e032a147f4aa7ad49110dc2f4fb945e7a9bb.zip | |
Keep a pane's filesystem state on the Pane instead of a slot-indexed table
addr, limit, the event queue and its readers, pty/data's queue, a waiting
run and the /log announcement flag lived in p.fs.panes[slot], reset when
the pane went; a reused slot is how the bug class came in. acme keeps the
same state on its Window (editors/acme/dat.h:226-266), so now Pane.fs
holds it: announced, retired (noteRetire, which still answers a waiting
run and drops the listener count first) and freed with the pane itself.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index 3ebea669..f08d20c8 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -543,7 +543,7 @@ fn open(p: *Pardes, req: Req, target: Target) Reply { .pane => |t| { const id = p.paneBySerial(t.serial) orelse return Reply.fail(req.tag, E.NOENT); const pn = p.panes[id].?; - const pf = &p.fs.panes[id]; + const pf = &pn.fs; if (t.file.inPty() and !pn.isTerminal()) return Reply.fail(req.tag, E.NOENT); switch (t.file) { .body => if (pn.isTerminal()) return screen.openSnapshot(p, req, false), @@ -605,7 +605,7 @@ fn releaseHandle(p: *Pardes, req: Req) Reply { if (t.file == .pty_run) return pty.releaseRun(p, req); if (t.file != .event and t.file != .pty_data) return .{ .tag = req.tag }; const id = p.paneBySerial(t.serial) orelse return .{ .tag = req.tag }; - const pf = &p.fs.panes[id]; + const pf = &p.panes[id].?.fs; if (t.file == .pty_data) { if (req.handle != reader_handle or pf.pty_readers == 0) return .{ .tag = req.tag }; pf.pty_readers -= 1; @@ -626,7 +626,7 @@ fn setattr(p: *Pardes, req: Req, target: Target) Reply { if (req.truncate) switch (target) { .pane => |t| { const id = p.paneBySerial(t.serial) orelse return Reply.fail(req.tag, E.NOENT); - if (pane.truncate(p, id, p.panes[id].?, t.file) != .ok) return Reply.fail(req.tag, E.NOMEM); + if (pane.truncate(p, p.panes[id].?, t.file) != .ok) return Reply.fail(req.tag, E.NOMEM); }, .top => {}, }; |
