summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-01-06 13:36:15 +0100
committerDaniel Mack <github@zonque.org>2016-01-06 13:36:15 +0100
commite433ebd2ffd8dca086061ebc79704276aa2f7363 (patch)
tree2f0902c1fb7d6a404aceb7686f2bd959b40f72d6 /src
parent0b460d9681a97652f2232b7ac5f481fe654a380b (diff)
parentd5bc32d10325d8ce0b8891590252344f75e69596 (diff)
Merge pull request #2261 from evverx/fix-test-rlimit-util
tests: don't change hard limit in test-rlimit-util
Diffstat (limited to 'src')
-rw-r--r--src/test/test-rlimit-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-rlimit-util.c b/src/test/test-rlimit-util.c
index 00d3ecc0de..24bfe7a60e 100644
--- a/src/test/test-rlimit-util.c
+++ b/src/test/test-rlimit-util.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
assert_se(getrlimit(RLIMIT_NOFILE, &old) == 0);
new.rlim_cur = MIN(5U, old.rlim_max);
- new.rlim_max = MIN(10U, old.rlim_max);
+ new.rlim_max = old.rlim_max;
assert_se(setrlimit(RLIMIT_NOFILE, &new) >= 0);
assert_se(rlimit_from_string("LimitNOFILE") == RLIMIT_NOFILE);
@@ -53,7 +53,7 @@ int main(int argc, char *argv[]) {
assert_se(old.rlim_max == new.rlim_max);
assert_se(getrlimit(RLIMIT_NOFILE, &old) == 0);
- high = RLIMIT_MAKE_CONST(old.rlim_max + 1);
+ high = RLIMIT_MAKE_CONST(old.rlim_max == RLIM_INFINITY ? old.rlim_max : old.rlim_max + 1);
assert_se(setrlimit_closest(RLIMIT_NOFILE, &high) == 0);
assert_se(getrlimit(RLIMIT_NOFILE, &new) == 0);
assert_se(new.rlim_max == old.rlim_max);