diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-04-21 11:45:07 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-04-21 11:45:07 -0400 |
commit | c61312596608bf819b693c04a395f1b4e3e0acf0 (patch) | |
tree | 5b88287042115d526ccb21132b7c158196cf0efc /src/conf | |
parent | c5d1adc56c22ead8caa9effcee0518a7a8ff3c06 (diff) | |
download | musl-c61312596608bf819b693c04a395f1b4e3e0acf0.tar.gz musl-c61312596608bf819b693c04a395f1b4e3e0acf0.tar.bz2 musl-c61312596608bf819b693c04a395f1b4e3e0acf0.tar.xz musl-c61312596608bf819b693c04a395f1b4e3e0acf0.zip |
fix broken sysconf when correct value is -1
this caused glib to try to allocate >2gb for getpwnam_r, and probably
numerous other problems.
Diffstat (limited to 'src/conf')
-rw-r--r-- | src/conf/sysconf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conf/sysconf.c b/src/conf/sysconf.c index 5b6c14e5..07072ccf 100644 --- a/src/conf/sysconf.c +++ b/src/conf/sysconf.c @@ -220,7 +220,7 @@ long sysconf(int name) } else if (values[name] == OFLOW) { if (name == _SC_ARG_MAX) return ARG_MAX; if (name == _SC_SEM_VALUE_MAX) return SEM_VALUE_MAX; - } else if (values[name] < 0) { + } else if (values[name] < OFLOW) { long lim[2]; __syscall(SYS_getrlimit, values[name]&16383, lim); return lim[0] < 0 ? LONG_MAX : lim[0]; |