diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 12:40:11 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:56:36 -0300 |
| commit | 36a51ddc67d0beb7d9851fb2425cf780a47fed36 (patch) | |
| tree | d534d3151d836ea7a275e9f118a89f2bbc0d0448 /src/ninep/screen.zig | |
| parent | 4917ae452a15ff4f32d97d215a99fdcfaab29d61 (diff) | |
| download | pardes-36a51ddc67d0beb7d9851fb2425cf780a47fed36.tar.gz pardes-36a51ddc67d0beb7d9851fb2425cf780a47fed36.zip | |
idioms #10, the 9P tree: every bufPrint that fell back to "" or a placeholder is proven to fit (catch unreachable, its why) or cut its argument to fit, /status, /listeners and the 9P reads that staged on gpa answer ENOMEM rather than read short, acme's pane ctl words and pty's files and signals are stringToEnum switches, a dirent's head and name are staged together or not at all, a repeated log record too long to count is pushed as its own line rather than dropped, and daemonList's set is named
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep/screen.zig')
| -rw-r--r-- | src/ninep/screen.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ninep/screen.zig b/src/ninep/screen.zig index 33a8717b..634ef640 100644 --- a/src/ninep/screen.zig +++ b/src/ninep/screen.zig @@ -70,12 +70,12 @@ pub fn readSnapshot(p: *Pardes, req: Req, pane: ?*Pane) Reply { } /// /listeners' text, a dial a line, in the step's scratch. -pub fn listenersText(p: *Pardes) []const u8 { +pub fn listenersText(p: *Pardes) std.Io.Writer.Error![]const u8 { var text: std.Io.Writer.Allocating = .init(p.scratch.allocator()); - if (p.fs.socket_path.len != 0) text.writer.print("unix!{s}\n", .{p.fs.socket_path}) catch {}; + if (p.fs.socket_path.len != 0) try text.writer.print("unix!{s}\n", .{p.fs.socket_path}); if (p.fs.tcp_address) |address| switch (address) { - .ip4 => |ip| text.writer.print("tcp!{d}.{d}.{d}.{d}!{d}\n", .{ ip.bytes[0], ip.bytes[1], ip.bytes[2], ip.bytes[3], ip.port }) catch {}, - .ip6 => |ip| text.writer.print("tcp!{f}!{d}\n", .{ std.Io.net.Ip6Address.Unresolved{ .bytes = ip.bytes, .interface_name = null }, ip.port }) catch {}, + .ip4 => |ip| try text.writer.print("tcp!{d}.{d}.{d}.{d}!{d}\n", .{ ip.bytes[0], ip.bytes[1], ip.bytes[2], ip.bytes[3], ip.port }), + .ip6 => |ip| try text.writer.print("tcp!{f}!{d}\n", .{ std.Io.net.Ip6Address.Unresolved{ .bytes = ip.bytes, .interface_name = null }, ip.port }), }; return text.written(); } |
