Subject: | setrlimit.t tries to increase hard limits |
Hello,
When hard limit is 0, setrlimit.t tries to increase it to 1, which is
not allowed.
$ ulimit -HS -c 0
$ ulimit -c 1
bash: ulimit: core file size: cannot modify limit: Operation not permitted
$ perl -Mblib t/setrlimit.t
...
# RLIMIT_CORE
# RLIM_INFINITY = -1
# lim = 4, oldsoft = 0, oldhard = 0
# lim = 4, newsoft = 1, newhard = 1
# set = (Operation not permitted), nowsoft = 0, nowhard = 0
...
not ok 14
$
This is also a problem for RedHat/Fedora build system, see
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=153178 for details.
The attached patch fixes the problem.
--
Alexey Tourbin
ALT Linux Team
--- BSD-Resource-1.24/t/setrlimit.t~ 2002-11-22 17:54:58 +0300
+++ BSD-Resource-1.24/t/setrlimit.t 2005-06-07 04:24:42 +0400
@@ -17,7 +17,7 @@
sub newlim {
my $old = shift;
- return ($old == RLIM_INFINITY) ? $old : ($old ? int(0.95 * $old) : 1);
+ return ($old == RLIM_INFINITY) ? $old : ($old ? int(0.95 * $old) : 0);
}
sub klim {