summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 14:37:21 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitd678a63e0abf2ba8994225a9f0fd0047fee4025a (patch)
tree9c1a13fe7895ec162e9ee24de2913f2375375241 /src/9p_io.zig
parent25c847e28ae77f5c648d423d64011736f55eda4a (diff)
downloadpardes-d678a63e0abf2ba8994225a9f0fd0047fee4025a.tar.gz
pardes-d678a63e0abf2ba8994225a9f0fd0047fee4025a.zip
Every catch unreachable, orelse unreachable and syscall assert outside tests is a real refusal or says why it cannot fire
A sweep for round 23's crash: a run's answer (pty/run) was bufPrint'd into 48 bytes with catch unreachable, so a foreground program's long name (macOS gives up to 32 bytes) panicked; it now cuts at the room, keeping its newline, in 96 bytes. The rest were numbers into buffers sized for them, a braille codepoint, pthread calls on the queue's own mutex, and pdf_view's resolved outline entries: each now carries a one-line comment saying why it cannot fire. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index 560c4ed6..91240b57 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -1638,6 +1638,7 @@ extern "c" fn unsetenv(name: [*:0]const u8) c_int;
pub fn start(io: std.Io, gpa: std.mem.Allocator, core: *pardes.Pardes) ?*Listener {
var name: [16]u8 = undefined;
+ // unreachable: a u32 is at most 10 digits
const fallback = std.fmt.bufPrint(&name, "{d}", .{@as(u32, @intCast(libc.getpid()))}) catch unreachable;
return listen(io, gpa, core, core.opts.ninep_name, fallback, core.opts.ninep_tcp, core.opts.ninep_quic) orelse {
core.reportError(0, "9p listener", error.ListenFailed);