diff options
author | Robert Rothenberg <rrwo@cpan.org> | 2020-03-25 08:57:09 +0000 |
---|---|---|
committer | Robert Rothenberg <rrwo@cpan.org> | 2020-03-25 08:57:09 +0000 |
commit | 39af69eafb71777ec2be274c9c43b3b85e386479 (patch) | |
tree | b1350fa5f016ce9589a06676ec4e51a3472b0004 | |
parent | 5760e153862336ceedcf1631ef9027c050996786 (diff) |
Test that getloadavg works before opting to use it
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | lib/Sys/CpuLoad.pm | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -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) |