From: Natanael Copa Date: Thu, 7 Dec 2017 22:18:54 +0000 (+0100) Subject: fix sysconf for infinite rlimits X-Git-Tag: v1.1.19~36 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3ec82877e7783f0706ba3c9e3c815cd2aa34059e;p=oweals%2Fmusl.git fix sysconf for infinite rlimits sysconf should return -1 for infinity, not LONG_MAX. --- diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c index b8b761d0..9ce330a5 100644 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c @@ -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; }