Commit 92407bfcd7
Changed files (1)
lib
std
os
linux
lib/std/os/linux/io_uring.zig
@@ -608,10 +608,10 @@ pub const CompletionQueue = struct {
};
inline fn check_errno(res: usize) !void {
- const errno = linux.getErrno(res);
- if (errno != 0) {
- if (errno == linux.ENOSYS) return error.UnsupportedKernel;
- return os.unexpectedErrno(errno);
+ switch (linux.getErrno(res)) {
+ 0 => return,
+ linux.ENOSYS => return error.UnsupportedKernel,
+ else => |errno| return os.unexpectedErrno(errno)
}
}