Skip to content

Commit c02a313

Browse files
committed
Fix SC_OPEN_MAX/SC_STREAM_MAX RLIM_INFINITY check
Compare rlim.Cur to unix.RLIM_INFINITY for equality. The current check can never be true since RLIM_INFINITY is the maximum value of the type. This follows the implementation on FreeBSD which performs the same check for equality.
1 parent 9705845 commit c02a313

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sysconf_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func sysconf(name int) (int64, error) {
8686
if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &rlim); err != nil {
8787
return -1, nil
8888
}
89-
if rlim.Cur > unix.RLIM_INFINITY {
89+
if rlim.Cur == unix.RLIM_INFINITY {
9090
return -1, nil
9191
}
9292
if rlim.Cur > _LONG_MAX {

0 commit comments

Comments
 (0)