projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1312768
)
fix sysconf for infinite rlimits
author
Natanael Copa
<ncopa@alpinelinux.org>
Thu, 7 Dec 2017 22:18:54 +0000
(23:18 +0100)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 15 Dec 2017 02:25:10 +0000
(21:25 -0500)
sysconf should return -1 for infinity, not LONG_MAX.
src/conf/sysconf.c
patch
|
blob
|
history
diff --git
a/src/conf/sysconf.c
b/src/conf/sysconf.c
index b8b761d01a3156c644179dfe8aeb670d34b36a31..9ce330a5cfb172ef38720c826200bfc5fc4620c2 100644
(file)
--- 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;
}