authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-12 20:55:29-07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-09-12 20:56:52-07:00
loge92b379fa32a2a06e5e51a54189310fec8a1ec7a
tree14518a646eca7a1b79b9b4e03249a8f180ccf754
parent1163f0e7be1400c7e2f80b5719114a7d1dc2cd36
signature Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

catch close errors in debug mode


2 files changed, 2 insertions(+), 2 deletions(-)

Dir.zig+1-1
......@@ -22,7 +22,7 @@ fd: nfs.Handle,
2222
2323// Resource allocation may fail; resource deallocation must succeed.
2424pub fn close(self: Dir) void {
25 return sys.close(@intFromEnum(self.fd)) catch {};
25 return sys.close(@intFromEnum(self.fd)) catch if (builtin.mode == .Debug) unreachable;
2626}
2727
2828pub fn openFile(self: Dir, sub_path: [:0]const u8, flags: OpenFileFlags) !File {
File.zig+1-1
......@@ -26,7 +26,7 @@ fd: nfs.Handle,
2626
2727// Resource allocation may fail; resource deallocation must succeed.
2828pub fn close(self: File) void {
29 sys.close(@intFromEnum(self.fd)) catch {};
29 sys.close(@intFromEnum(self.fd)) catch if (builtin.mode == .Debug) unreachable;
3030}
3131
3232const R = nio.Readable(@This(), ._bare);