Code

core: Changed internal API to allow for per-plugin intervals.
[collectd.git] / src / onewire.c
index 09a6bf0926154369c3fe75e408a3c79c9b194cfe..8d4e600b7fb218e23f5a21776e45148f674407b2 100644 (file)
@@ -125,7 +125,7 @@ static int cow_read_values (const char *path, const char *name,
     const ow_family_features_t *family_info)
 {
   value_t values[1];
-  value_list_t vl = VALUE_LIST_INIT;
+  value_list_t vl = VALUE_LIST_INIT (plugin_interval);
   int success = 0;
   size_t i;
 
@@ -306,6 +306,8 @@ static int cow_init (void)
     return (1);
   }
 
+  if (ow_interval <= 0)
+    ow_interval = plugin_interval;
   CDTIME_T_TO_TIMESPEC (ow_interval, &cb_interval);
 
   plugin_register_complex_read (/* group = */ NULL, "onewire", cow_read,
@@ -316,8 +318,9 @@ static int cow_init (void)
   return (0);
 } /* int cow_init */
 
-void module_register (void)
+void module_register (plugin_loaddata_t *data)
 {
+  PLUGIN_INIT_INTERVAL (data);
   plugin_register_init ("onewire", cow_init);
   plugin_register_config ("onewire", cow_load_config,
     config_keys, config_keys_num);