aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0001-fix-sysconf-for-infinite-rlimits.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0001-fix-sysconf-for-infinite-rlimits.patch')
-rw-r--r--main/musl/0001-fix-sysconf-for-infinite-rlimits.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/main/musl/0001-fix-sysconf-for-infinite-rlimits.patch b/main/musl/0001-fix-sysconf-for-infinite-rlimits.patch
new file mode 100644
index 0000000000..b465f49655
--- /dev/null
+++ b/main/musl/0001-fix-sysconf-for-infinite-rlimits.patch
@@ -0,0 +1,26 @@
+From 3ec82877e7783f0706ba3c9e3c815cd2aa34059e Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 7 Dec 2017 23:18:54 +0100
+Subject: [PATCH] fix sysconf for infinite rlimits
+
+sysconf should return -1 for infinity, not LONG_MAX.
+---
+ src/conf/sysconf.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+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;
+ }
+
+--
+2.15.0
+