projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added missing include of "collectd.h"
[collectd.git]
/
src
/
perl.c
diff --git
a/src/perl.c
b/src/perl.c
index
9268086
..
8df8fd4
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-706,10
+706,8
@@
static int value_list2hv(pTHX_ value_list_t *vl, data_set_t *ds, HV *hash) {
static int notification_meta2av(pTHX_ notification_meta_t *meta, AV *array) {
int meta_num = 0;
static int notification_meta2av(pTHX_ notification_meta_t *meta, AV *array) {
int meta_num = 0;
-
- while (meta) {
+ for (notification_meta_t *m = meta; m != NULL; m = m->next) {
++meta_num;
++meta_num;
- meta = meta->next;
}
av_extend(array, meta_num);
}
av_extend(array, meta_num);
@@
-1644,23
+1642,23
@@
static void _plugin_register_generic_userdata(pTHX, int type,
*/
static XS(Collectd_plugin_register_read) {
*/
static XS(Collectd_plugin_register_read) {
-
return
_plugin_register_generic_userdata(aTHX, PLUGIN_READ, "read");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_READ, "read");
}
static XS(Collectd_plugin_register_write) {
}
static XS(Collectd_plugin_register_write) {
-
return
_plugin_register_generic_userdata(aTHX, PLUGIN_WRITE, "write");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_WRITE, "write");
}
static XS(Collectd_plugin_register_log) {
}
static XS(Collectd_plugin_register_log) {
-
return
_plugin_register_generic_userdata(aTHX, PLUGIN_LOG, "log");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_LOG, "log");
}
static XS(Collectd_plugin_register_notification) {
}
static XS(Collectd_plugin_register_notification) {
-
return
_plugin_register_generic_userdata(aTHX, PLUGIN_NOTIF, "notification");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_NOTIF, "notification");
}
static XS(Collectd_plugin_register_flush) {
}
static XS(Collectd_plugin_register_flush) {
-
return
_plugin_register_generic_userdata(aTHX, PLUGIN_FLUSH, "flush");
+ _plugin_register_generic_userdata(aTHX, PLUGIN_FLUSH, "flush");
}
typedef int perl_unregister_function_t(const char *name);
}
typedef int perl_unregister_function_t(const char *name);
@@
-1687,8
+1685,6
@@
static void _plugin_unregister_generic(pTHX, perl_unregister_function_t *unreg,
unreg(SvPV_nolen(ST(0)));
XSRETURN_EMPTY;
unreg(SvPV_nolen(ST(0)));
XSRETURN_EMPTY;
-
- return;
} /* static void _plugin_unregister_generic ( ... ) */
/*
} /* static void _plugin_unregister_generic ( ... ) */
/*
@@
-1702,24
+1698,24
@@
static void _plugin_unregister_generic(pTHX, perl_unregister_function_t *unreg,
*/
static XS(Collectd_plugin_unregister_read) {
*/
static XS(Collectd_plugin_unregister_read) {
-
return
_plugin_unregister_generic(aTHX, plugin_unregister_read, "read");
+ _plugin_unregister_generic(aTHX, plugin_unregister_read, "read");
}
static XS(Collectd_plugin_unregister_write) {
}
static XS(Collectd_plugin_unregister_write) {
-
return
_plugin_unregister_generic(aTHX, plugin_unregister_write, "write");
+ _plugin_unregister_generic(aTHX, plugin_unregister_write, "write");
}
static XS(Collectd_plugin_unregister_log) {
}
static XS(Collectd_plugin_unregister_log) {
-
return
_plugin_unregister_generic(aTHX, plugin_unregister_log, "log");
+ _plugin_unregister_generic(aTHX, plugin_unregister_log, "log");
}
static XS(Collectd_plugin_unregister_notification) {
}
static XS(Collectd_plugin_unregister_notification) {
-
return
_plugin_unregister_generic(aTHX, plugin_unregister_notification,
-
"notification");
+ _plugin_unregister_generic(aTHX, plugin_unregister_notification,
+ "notification");
}
static XS(Collectd_plugin_unregister_flush) {
}
static XS(Collectd_plugin_unregister_flush) {
-
return
_plugin_unregister_generic(aTHX, plugin_unregister_flush, "flush");
+ _plugin_unregister_generic(aTHX, plugin_unregister_flush, "flush");
}
/*
}
/*
@@
-2093,7
+2089,7
@@
static int perl_init(void) {
/* Lock the base thread to avoid race conditions with c_ithread_create().
* See https://github.com/collectd/collectd/issues/9 and
* https://github.com/collectd/collectd/issues/1706 for details.
/* Lock the base thread to avoid race conditions with c_ithread_create().
* See https://github.com/collectd/collectd/issues/9 and
* https://github.com/collectd/collectd/issues/1706 for details.
- */
+
*/
assert(aTHX == perl_threads->head->interp);
pthread_mutex_lock(&perl_threads->mutex);
assert(aTHX == perl_threads->head->interp);
pthread_mutex_lock(&perl_threads->mutex);
@@
-2184,7
+2180,7
@@
static void perl_log(int level, const char *msg, user_data_t *user_data) {
/* Lock the base thread if this is not called from one of the read threads
* to avoid race conditions with c_ithread_create(). See
* https://github.com/collectd/collectd/issues/9 for details.
/* Lock the base thread if this is not called from one of the read threads
* to avoid race conditions with c_ithread_create(). See
* https://github.com/collectd/collectd/issues/9 for details.
- */
+
*/
if (aTHX == perl_threads->head->interp)
pthread_mutex_lock(&perl_threads->mutex);
if (aTHX == perl_threads->head->interp)
pthread_mutex_lock(&perl_threads->mutex);
@@
-2343,14
+2339,25
@@
static int g_interval_set(pTHX_ SV *var, MAGIC *mg) {
return 0;
} /* static int g_interval_set (pTHX_ SV *, MAGIC *) */
return 0;
} /* static int g_interval_set (pTHX_ SV *, MAGIC *) */
-static MGVTBL g_pv_vtbl = {g_pv_get, g_pv_set, NULL, NULL, NULL, NULL, NULL
+static MGVTBL g_pv_vtbl = {g_pv_get,
+ g_pv_set,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
#if HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL
,
NULL
#endif
};
#if HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL
,
NULL
#endif
};
-static MGVTBL g_interval_vtbl = {g_interval_get, g_interval_set, NULL, NULL,
- NULL, NULL, NULL
+static MGVTBL g_interval_vtbl = {g_interval_get,
+ g_interval_set,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
#if HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL
,
NULL
#if HAVE_PERL_STRUCT_MGVTBL_SVT_LOCAL
,
NULL
@@
-2385,8
+2392,8
@@
static void xs_init(pTHX) {
* tie() in Perl) */
/* global strings */
struct {
* tie() in Perl) */
/* global strings */
struct {
-
char name[64];
-
char *var;
+ char name[64];
+ char *var;
} g_strings[] = {{"Collectd::hostname_g", hostname_g}, {"", NULL}};
for (int i = 0; '\0' != g_strings[i].name[0]; ++i) {
} g_strings[] = {{"Collectd::hostname_g", hostname_g}, {"", NULL}};
for (int i = 0; '\0' != g_strings[i].name[0]; ++i) {