fix min usage in src/os

This commit is contained in:
Mitchell Hashimoto
2023-06-25 11:17:51 -07:00
parent e3affae381
commit 8a83a1e4a9

View File

@ -20,7 +20,7 @@ pub fn fixMaxFiles() void {
// setrlimit() now returns with errno set to EINVAL in places that historically succeeded.
// It no longer accepts "rlim_cur = RLIM.INFINITY" for RLIM.NOFILE.
// Use "rlim_cur = min(OPEN_MAX, rlim_max)".
lim.max = std.math.min(std.os.darwin.OPEN_MAX, lim.max);
lim.max = @min(std.os.darwin.OPEN_MAX, lim.max);
}
// If we're already at the max, we're done.