diff --git a/src/perl.c b/src/perl.c
index dd82ed9487d3531afe131463a6ba7f6074704e60..a2f5da299bf92ae9679d3fd69b478f691540e3e4 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
sfree (data); \
} while (0)
+/*
+ * Public variable
+ */
+extern char **environ;
+
/*
* private variables
*/
if (NULL != (tmp = hv_fetch (hash, "type", 4, 0))) {
ds->type = SvIV (*tmp);
- if ((DS_TYPE_COUNTER != ds->type) && (DS_TYPE_GAUGE != ds->type) && (DS_TYPE_DERIVE != ds->type) && (DS_TYPE_ABSOLUTE != ds->type)) {
+ if ((DS_TYPE_COUNTER != ds->type)
+ && (DS_TYPE_GAUGE != ds->type)
+ && (DS_TYPE_DERIVE != ds->type)
+ && (DS_TYPE_ABSOLUTE != ds->type)) {
log_err ("hv2data_source: Invalid DS type.");
return -1;
}
else if (DS_TYPE_GAUGE == ds->ds[i].type)
val = newSVnv (vl->values[i].gauge);
else if (DS_TYPE_DERIVE == ds->ds[i].type)
- val = newSVnv (vl->values[i].derive);
+ val = newSViv (vl->values[i].derive);
else if (DS_TYPE_ABSOLUTE == ds->ds[i].type)
- val = newSVnv (vl->values[i].absolute);
+ val = newSViv (vl->values[i].absolute);
if (NULL == av_store (values, i, val)) {
av_undef (values);