Author: stas Date: Sat Dec 11 08:07:25 2004 New Revision: 111603 URL: http://svn.apache.org/viewcvs?view=rev&rev=111603 Log: - move the supported platform code into a constant - specify which platform is not supported in the error message
Modified: perl/modperl/trunk/lib/Apache/SizeLimit.pm Modified: perl/modperl/trunk/lib/Apache/SizeLimit.pm Url: http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/Apache/SizeLimit.pm?view=diff&rev=111603&p1=perl/modperl/trunk/lib/Apache/SizeLimit.pm&r1=111602&p2=perl/modperl/trunk/lib/Apache/SizeLimit.pm&r2=111603 ============================================================================== --- perl/modperl/trunk/lib/Apache/SizeLimit.pm (original) +++ perl/modperl/trunk/lib/Apache/SizeLimit.pm Sat Dec 11 08:07:25 2004 @@ -27,9 +27,10 @@ use Config; -use constant WIN32 => $^O eq 'MSWin32'; -use constant SOLARIS => $^O eq 'solaris'; -use constant LINUX => $^O eq 'linux'; +use constant WIN32 => $^O eq 'MSWin32'; +use constant SOLARIS => $^O eq 'solaris'; +use constant LINUX => $^O eq 'linux'; +use constant BSD_LIKE => $^O =~ /(bsd|aix|darwin)/i; use Apache::Const -compile => qw(OK DECLINED); @@ -54,7 +55,7 @@ $HOW_BIG_IS_IT = \&linux_size_check; - } elsif ( $Config{'osname'} =~ /(bsd|aix|darwin)/i ) { + } elsif (BSD_LIKE) { # will getrusage work on all BSDs? I should hope so. if ( eval { require BSD::Resource } ) { @@ -75,7 +76,7 @@ } else { - die "Apache::SizeLimit not implemented on your platform."; + die "Apache::SizeLimit not implemented on $^O"; } }