projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
01d7cbf
)
Collectd::Unixsock: Improved error handling in putval().
author
Sebastian Harl
<sh@tokkee.org>
Thu, 19 Feb 2009 10:03:01 +0000
(11:03 +0100)
committer
Sebastian Harl
<sh@tokkee.org>
Thu, 19 Feb 2009 12:51:59 +0000
(13:51 +0100)
bindings/perl/Collectd/Unixsock.pm
patch
|
blob
|
history
diff --git
a/bindings/perl/Collectd/Unixsock.pm
b/bindings/perl/Collectd/Unixsock.pm
index
eb6e389
..
4403178
100644
(file)
--- a/
bindings/perl/Collectd/Unixsock.pm
+++ b/
bindings/perl/Collectd/Unixsock.pm
@@
-287,7
+287,21
@@
sub putval
}
else
{
- my $time = $args{'time'} ? $args{'time'} : time ();
+ my $time;
+
+ if ("ARRAY" ne ref ($args{'values'}))
+ {
+ cluck ("Invalid `values' argument (expected an array ref)");
+ return;
+ }
+
+ if (! scalar @{$args{'values'}})
+ {
+ cluck ("Empty `values' array");
+ return;
+ }
+
+ $time = $args{'time'} ? $args{'time'} : time ();
$values = join (':', $time, map { defined ($_) ? $_ : 'U' } (@{$args{'values'}}));
}