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,...@@ -22,7 +22,7 @@ fd: nfs.Handle,
2222
23// Resource allocation may fail; resource deallocation must succeed.23// Resource allocation may fail; resource deallocation must succeed.
24pub fn close(self: Dir) void {24pub 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;
26}26}
2727
28pub fn openFile(self: Dir, sub_path: [:0]const u8, flags: OpenFileFlags) !File {28pub fn openFile(self: Dir, sub_path: [:0]const u8, flags: OpenFileFlags) !File {
File.zig+1-1
...@@ -26,7 +26,7 @@ fd: nfs.Handle,...@@ -26,7 +26,7 @@ fd: nfs.Handle,
2626
27// Resource allocation may fail; resource deallocation must succeed.27// Resource allocation may fail; resource deallocation must succeed.
28pub fn close(self: File) void {28pub fn close(self: File) void {
29 sys.close(@intFromEnum(self.fd)) catch {};29 sys.close(@intFromEnum(self.fd)) catch if (builtin.mode == .Debug) unreachable;
30}30}
3131
32const R = nio.Readable(@This(), ._bare);32const R = nio.Readable(@This(), ._bare);