fix: also use safe_unexpectedErrno

This commit is contained in:
CJ van den Berg 2026-02-11 14:45:16 +01:00
parent a581bef152
commit 3d58186b1a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -662,7 +662,7 @@ fn safe_file_read(self: std.fs.File, buffer: []u8) (error{FileHandleInvalidForRe
fn safe_posix_read(fd: std.posix.fd_t, buf: []u8) (error{FileHandleInvalidForReading} || std.fs.File.ReadError)!usize { fn safe_posix_read(fd: std.posix.fd_t, buf: []u8) (error{FileHandleInvalidForReading} || std.fs.File.ReadError)!usize {
const native_os = builtin.os.tag; const native_os = builtin.os.tag;
const unexpectedErrno = std.posix.unexpectedErrno; const unexpectedErrno = safe_unexpectedErrno;
const maxInt = std.math.maxInt; const maxInt = std.math.maxInt;
const system = std.posix.system; const system = std.posix.system;
const errno = std.posix.errno; const errno = std.posix.errno;
@ -727,6 +727,10 @@ fn safe_posix_read(fd: std.posix.fd_t, buf: []u8) (error{FileHandleInvalidForRea
} }
} }
fn safe_unexpectedErrno(_: std.posix.system.E) std.posix.UnexpectedError {
return error.Unexpected;
}
fn merge_pending_files(self: *Self) OutOfMemoryError!void { fn merge_pending_files(self: *Self) OutOfMemoryError!void {
defer self.sort_files_by_mtime(); defer self.sort_files_by_mtime();
const existing = try self.files.toOwnedSlice(self.allocator); const existing = try self.files.toOwnedSlice(self.allocator);