summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 21:25:38 -0300
committerGabriel Schneider <[email protected]>2026-10-01 21:55:57 -0300
commit97efe2d711b8b357157db2cb3402c3488064117a (patch)
tree4f3b403578a7116cdc75f60200e85c1410df0dbb /src/9p_io.zig
parent778de441bc5645bf15ba8d3dff83766fbb70499e (diff)
downloadpardes-97efe2d711b8b357157db2cb3402c3488064117a.tar.gz
pardes-97efe2d711b8b357157db2cb3402c3488064117a.zip
A refused Putall is answered once the other saves have landed; a bad Tab width is invalid (EINVAL), from a pane's exec too; Incl refuses a relative or missing directory and takes - only alone
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index 671a1852..46bbb2ba 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -316,9 +316,20 @@ pub const Listener = struct {
// mount: 9ns answers nothing else on it while a clunk is out, and
// the editor's step may be out opening a file through that mount.
if (fills) return conn.reply(&reply, core.fsPayload(reply));
- // A refusal answers at once: its text may be in the core's one
- // buffer for it, which a request run while this one waited would
- // write over.
+ // A refusal that left saves going (Putall's one refused among the
+ // rest) is answered once they have landed, its words copied out of
+ // the core's one buffer for them, which a request run meanwhile
+ // could write over.
+ if (reply.status == .err and core.effects_len != 0 and !core.quit) {
+ var kept: [320]u8 = undefined;
+ const words = kept[0..@min(reply.ename.len, kept.len)];
+ @memcpy(words, reply.ename[0..words.len]);
+ var waited = reply;
+ waited.ename = words;
+ pardes.turn.awaitSettled(epoch);
+ return conn.reply(&waited, "");
+ }
+ // Any other refusal answers at once, for the same buffer's sake.
if (reply.status == .err) return conn.reply(&reply, "");
// A write that quits the editor (Kill) is answered now: the editor
// is on its way out and will settle nothing this could wait for,