mirror of git://git.musl-libc.org/musl
fix sysconf for infinite rlimits
sysconf should return -1 for infinity, not LONG_MAX.
This commit is contained in:
parent
131276809f
commit
3ec82877e7
|
@ -174,6 +174,8 @@ long sysconf(int name)
|
|||
} else if (values[name] < -256) {
|
||||
struct rlimit lim;
|
||||
getrlimit(values[name]&16383, &lim);
|
||||
if (lim.rlim_cur == RLIM_INFINITY)
|
||||
return -1;
|
||||
return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue