diff options
| author | xackus <14938807+xackus@users.noreply.github.com> | 2020-11-03 00:58:35 +0100 |
|---|---|---|
| committer | xackus <14938807+xackus@users.noreply.github.com> | 2020-11-03 00:58:35 +0100 |
| commit | e023a5fe5d8e0c2849c160ffab993ec1e378681c (patch) | |
| tree | 7c245e3fb0d5ca114f66863f0d6528d7f07b7716 | |
| parent | 8dda64fa3e1d3249baa948dc0558e3f65d71e6df (diff) | |
| download | zig-e023a5fe5d8e0c2849c160ffab993ec1e378681c.tar.gz zig-e023a5fe5d8e0c2849c160ffab993ec1e378681c.zip | |
force comptime on isDarwin
| -rw-r--r-- | src/main.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index 90a0aba460..7df8cb1eda 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2986,13 +2986,13 @@ fn gimmeMoreOfThoseSweetSweetFileDescriptors() void { const posix = std.os; var lim = posix.getrlimit(.NOFILE) catch return; // Oh well; we tried. - if (std.Target.current.isDarwin()) { + if (comptime std.Target.current.isDarwin()) { // On Darwin, `NOFILE` is bounded by a hardcoded value `OPEN_MAX`. // According to the man pages for setrlimit(): // 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(posix.darwin.OPEN_MAX, lim.max); + lim.max = std.math.min(std.os.darwin.OPEN_MAX, lim.max); } if (lim.cur == lim.max) return; |
