perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pete Houston <...@openstrike.co.uk>
Subject Re: [RELEASE CANDIDATE] mod_perl-2.0.11 RC3
Date Thu, 03 Oct 2019 09:07:57 GMT
On Wed, Oct 02, 2019 at 06:07:39PM +0100, Steve Hay wrote:
> 
> I'm not sure about this area, but if it works for with your patch then
> it's probably an improvement :-)
> 
> Just out of interest, does the following alternative patch work?
> 
> Index: lib/Apache2/Resource.pm
> ===================================================================
> --- lib/Apache2/Resource.pm     (revision 1866274)
> +++ lib/Apache2/Resource.pm     (working copy)
> @@ -115,8 +115,7 @@
>                    "</tr>");
> 
>      for my $res (keys %$lim) {
> -        my $val = eval "&BSD::Resource::${res}()";
> -        my ($soft, $hard) = getrlimit $val;
> +        my ($soft, $hard) = getrlimit($lim->{$res});
>          (my $limit = $res) =~ s/^RLIMIT_//;
>          ($soft, $hard) = ("$soft " . BM($soft), "$hard ". BM($hard))
>              if $is_mb{$limit};

Yes, that works just as well for me.

> This avoids making the &BSD::Resource::${res}() calls, which are what
> is returning undef for you in some cases. Or does this fail just the
> same because some of the values of %$lim are also undef anyway?

The %$lim values are not undef. See the attached stand-alone test and
output for the problematic values which I see and which also shows that
the limits for those resources are still retrievable via getrlimit().

HTH,

Pete
-- 
Openstrike - improving business through open source
https://www.openstrike.co.uk/ or call 01722 770036

Mime
View raw message