projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into ff/subsecond
[collectd.git]
/
src
/
perl.c
diff --git
a/src/perl.c
b/src/perl.c
index
7260580
..
116c34f
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-397,7
+397,10
@@
static int hv2value_list (pTHX_ HV *hash, value_list_t *vl)
}
if (NULL != (tmp = hv_fetch (hash, "time", 4, 0)))
}
if (NULL != (tmp = hv_fetch (hash, "time", 4, 0)))
- vl->time = (time_t)SvIV (*tmp);
+ {
+ double t = SvNV (*tmp);
+ vl->time = DOUBLE_TO_CDTIME_T (t);
+ }
if (NULL != (tmp = hv_fetch (hash, "interval", 8, 0)))
vl->interval = SvIV (*tmp);
if (NULL != (tmp = hv_fetch (hash, "interval", 8, 0)))
vl->interval = SvIV (*tmp);
@@
-552,9
+555,12
@@
static int hv2notification (pTHX_ HV *hash, notification_t *n)
n->severity = NOTIF_FAILURE;
if (NULL != (tmp = hv_fetch (hash, "time", 4, 0)))
n->severity = NOTIF_FAILURE;
if (NULL != (tmp = hv_fetch (hash, "time", 4, 0)))
- n->time = (time_t)SvIV (*tmp);
+ {
+ double t = SvNV (*tmp);
+ n->time = DOUBLE_TO_CDTIME_T (t);
+ }
else
else
- n->time =
time (NULL
);
+ n->time =
cdtime (
);
if (NULL != (tmp = hv_fetch (hash, "message", 7, 0)))
sstrncpy (n->message, SvPV_nolen (*tmp), sizeof (n->message));
if (NULL != (tmp = hv_fetch (hash, "message", 7, 0)))
sstrncpy (n->message, SvPV_nolen (*tmp), sizeof (n->message));
@@
-672,8
+678,11
@@
static int value_list2hv (pTHX_ value_list_t *vl, data_set_t *ds, HV *hash)
return -1;
if (0 != vl->time)
return -1;
if (0 != vl->time)
- if (NULL == hv_store (hash, "time", 4, newSViv (vl->time), 0))
+ {
+ double t = CDTIME_T_TO_DOUBLE (vl->time);
+ if (NULL == hv_store (hash, "time", 4, newSVnv (t), 0))
return -1;
return -1;
+ }
if (NULL == hv_store (hash, "interval", 8, newSViv (vl->interval), 0))
return -1;
if (NULL == hv_store (hash, "interval", 8, newSViv (vl->interval), 0))
return -1;
@@
-754,8
+763,11
@@
static int notification2hv (pTHX_ notification_t *n, HV *hash)
return -1;
if (0 != n->time)
return -1;
if (0 != n->time)
- if (NULL == hv_store (hash, "time", 4, newSViv (n->time), 0))
+ {
+ double t = CDTIME_T_TO_DOUBLE (n->time);
+ if (NULL == hv_store (hash, "time", 4, newSVnv (t), 0))
return -1;
return -1;
+ }
if ('\0' != *n->message)
if (NULL == hv_store (hash, "message", 7, newSVpv (n->message, 0), 0))
if ('\0' != *n->message)
if (NULL == hv_store (hash, "message", 7, newSVpv (n->message, 0), 0))
@@
-1106,11
+1118,15
@@
static int pplugin_call_all (pTHX_ int type, ...)
XPUSHs (sv_2mortal (newRV_noinc ((SV *)notif)));
}
else if (PLUGIN_FLUSH == type) {
XPUSHs (sv_2mortal (newRV_noinc ((SV *)notif)));
}
else if (PLUGIN_FLUSH == type) {
+ cdtime_t timeout;
+
/*
* $_[0] = $timeout;
* $_[1] = $identifier;
*/
/*
* $_[0] = $timeout;
* $_[1] = $identifier;
*/
- XPUSHs (sv_2mortal (newSViv (va_arg (ap, int))));
+ timeout = va_arg (ap, cdtime_t);
+
+ XPUSHs (sv_2mortal (newSVnv (CDTIME_T_TO_DOUBLE (timeout))));
XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0)));
}
XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0)));
}
@@
-1986,7
+2002,7
@@
static int perl_notify (const notification_t *notif,
return pplugin_call_all (aTHX_ PLUGIN_NOTIF, notif);
} /* static int perl_notify (const notification_t *) */
return pplugin_call_all (aTHX_ PLUGIN_NOTIF, notif);
} /* static int perl_notify (const notification_t *) */
-static int perl_flush (
in
t timeout, const char *identifier,
+static int perl_flush (
cdtime_
t timeout, const char *identifier,
user_data_t __attribute__((unused)) *user_data)
{
dTHX;
user_data_t __attribute__((unused)) *user_data)
{
dTHX;