From d370005d344507fc7ca548dcf488d29d3faad865 Mon Sep 17 00:00:00 2001 From: Kitty-Cricket Piapiac Date: Mon, 31 Jul 2023 22:10:42 -0700 Subject: [PATCH] std.process.totalSystemMemory: return correct error type on FreeBSD --- lib/std/process.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/process.zig b/lib/std/process.zig index c500ac9cf4..fe5a44d3ad 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1168,7 +1168,7 @@ pub fn totalSystemMemory() TotalSystemMemoryError!usize { var len: usize = @sizeOf(c_ulong); os.sysctlbynameZ("hw.physmem", &physmem, &len, null, 0) catch |err| switch (err) { error.NameTooLong, error.UnknownName => unreachable, - else => |e| return e, + else => return error.UnknownTotalSystemMemory, }; return @as(usize, @intCast(physmem)); },