summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Rothenberg <rrwo@cpan.org>2020-03-25 08:57:09 +0000
committerRobert Rothenberg <rrwo@cpan.org>2020-03-25 08:57:09 +0000
commit39af69eafb71777ec2be274c9c43b3b85e386479 (patch)
treeb1350fa5f016ce9589a06676ec4e51a3472b0004
parent5760e153862336ceedcf1631ef9027c050996786 (diff)
Test that getloadavg works before opting to use it
-rw-r--r--Changes4
-rw-r--r--lib/Sys/CpuLoad.pm2
2 files changed, 5 insertions, 1 deletions
diff --git a/Changes b/Changes
index 55027c5..d93cb38 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,10 @@
Revision history for Perl extension {{$dist->name}}:
{{$NEXT}}
+ [Enhancements]
+ - Test that getloadavg system call works before opting to use that
+ method.
+
[Bug Fixes]
- The return value of getloadavg is now checked, #4.
diff --git a/lib/Sys/CpuLoad.pm b/lib/Sys/CpuLoad.pm
index de0f6a4..58e39c0 100644
--- a/lib/Sys/CpuLoad.pm
+++ b/lib/Sys/CpuLoad.pm
@@ -54,7 +54,7 @@ sub import {
my $this = __PACKAGE__;
my $os = lc $^O;
- if ( $os =~ /^(darwin|freebsd|openbsd|linux)$/ ) {
+ if ( _getbsdload() ) {
no strict 'refs'; ## no critic (ProhibitNoStrict)