From: Florian Forster Date: Mon, 16 Mar 2009 15:15:11 +0000 (+0100) Subject: src/plugin.[ch]: Pass an interval to `plugin_register_complex_read'. X-Git-Tag: collectd-4.7.0~114 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5e44402e816ffa5087a3ec310b78494d06fe4900;p=collectd.git src/plugin.[ch]: Pass an interval to `plugin_register_complex_read'. --- diff --git a/src/java.c b/src/java.c index c6d4aeef..243e8f1e 100644 --- a/src/java.c +++ b/src/java.c @@ -1407,7 +1407,8 @@ static jint JNICALL cjni_api_register_read (JNIEnv *jvm_env, /* {{{ */ ud.data = (void *) cbi; ud.free_func = cjni_callback_info_destroy; - plugin_register_complex_read (cbi->name, cjni_read, &ud); + plugin_register_complex_read (cbi->name, cjni_read, + /* interval = */ NULL, &ud); (*jvm_env)->DeleteLocalRef (jvm_env, o_read); diff --git a/src/plugin.c b/src/plugin.c index 8fdd7bba..5a7a52a2 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -679,7 +679,9 @@ int plugin_register_read (const char *name, } /* int plugin_register_read */ int plugin_register_complex_read (const char *name, - plugin_read_cb callback, user_data_t *user_data) + plugin_read_cb callback, + const struct timespec *interval, + user_data_t *user_data) { read_func_t *rf; @@ -705,8 +707,10 @@ int plugin_register_complex_read (const char *name, rf->rf_callback = (void *) callback; sstrncpy (rf->rf_name, name, sizeof (rf->rf_name)); rf->rf_type = RF_COMPLEX; - rf->rf_interval.tv_sec = 0; - rf->rf_interval.tv_nsec = 0; + if (interval != NULL) + { + rf->rf_interval = *interval; + } rf->rf_effective_interval = rf->rf_interval; /* Set user data */ diff --git a/src/plugin.h b/src/plugin.h index bc4b07c2..e54b27d6 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -248,7 +248,9 @@ int plugin_register_init (const char *name, int plugin_register_read (const char *name, int (*callback) (void)); int plugin_register_complex_read (const char *name, - plugin_read_cb callback, user_data_t *user_data); + plugin_read_cb callback, + const struct timespec *interval, + user_data_t *user_data); int plugin_register_write (const char *name, plugin_write_cb callback, user_data_t *user_data); int plugin_register_flush (const char *name,