X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fperl.c;h=a2f5da299bf92ae9679d3fd69b478f691540e3e4;hb=9c98fa31ef50a6ff849d36cac4f5297faa6f7909;hp=dd82ed9487d3531afe131463a6ba7f6074704e60;hpb=25ac639c505394e4ae9600ee62f5d5aeea97c6d4;p=collectd.git diff --git a/src/perl.c b/src/perl.c index dd82ed94..a2f5da29 100644 --- a/src/perl.c +++ b/src/perl.c @@ -145,6 +145,11 @@ typedef struct { } while (0) /* + * Public variable + */ +extern char **environ; + +/* * private variables */ @@ -269,7 +274,10 @@ static int hv2data_source (pTHX_ HV *hash, data_source_t *ds) 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; } @@ -646,9 +654,9 @@ static int value_list2hv (pTHX_ value_list_t *vl, data_set_t *ds, HV *hash) 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);