From 1c7fd4c48f61695f396765c2f273b560a2e19963 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 4 Nov 2026 23:52:39 -0300 Subject: ninep ctl: a control message's refusal is one refuseQuoting with a tail, so refuseTo and the column ctl's two hand-built refusals, each cut at its own length, go; a captured run's failure is one failedWrite, said three times before; get returns getRefused's words, already in ename, where it copied them out and back; a constant was formatted into a throwaway buffer; writeSettingsOf had no caller; the tests' no-op spawn host is testing.zig's starting, not four copies Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/ninep/events.zig | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/ninep/events.zig') diff --git a/src/ninep/events.zig b/src/ninep/events.zig index 68f9f3e7..bc43dbfd 100644 --- a/src/ninep/events.zig +++ b/src/ninep/events.zig @@ -865,11 +865,7 @@ pub fn writeEvent(p: *Pardes, asked: Req, id: usize) Reply { else => unreachable, } } - if (p.fs.failure_len > 0) { - const failure = p.fs.failure[0..p.fs.failure_len]; - return tree.failText(req.tag, ctl.failureErrno(failure), std.fmt.bufPrint(&p.fs.ename, "{s}", .{failure}) catch failure); - } - return .{ .tag = req.tag, .written = @intCast(asked.data.len) }; + return ctl.failedWrite(p, req.tag) orelse .{ .tag = req.tag, .written = @intCast(asked.data.len) }; } // ---- tests ---- -- cgit v1.3