X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fplugin.c;h=eb98a7a33a3944ccf5851147e6e96f702c0d1b62;hb=ac23a826b01e66fa43c51ce0678b80b5b96f5a59;hp=e32c8f9c900faa3f7bd36b91296b3091287e05c2;hpb=1f5513547a11512077e64769d3e08a2df35105a3;p=collectd.git diff --git a/src/plugin.c b/src/plugin.c index e32c8f9c..eb98a7a3 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,6 @@ /** * collectd - src/plugin.c - * Copyright (C) 2005-2010 Florian octo Forster + * Copyright (C) 2005-2011 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -36,7 +36,6 @@ #include "utils_llist.h" #include "utils_heap.h" #include "utils_cache.h" -#include "utils_threshold.h" #include "filter_chain.h" /* @@ -729,6 +728,17 @@ static int plugin_insert_read (read_func_t *rf) } } + le = llist_search (read_list, rf->rf_name); + if (le != NULL) + { + pthread_mutex_unlock (&read_lock); + WARNING ("The read function \"%s\" is already registered. " + "Check for duplicate \"LoadPlugin\" lines " + "in your configuration!", + rf->rf_name); + return (EINVAL); + } + le = llentry_create (rf->rf_name, rf); if (le == NULL) { @@ -1359,7 +1369,7 @@ int plugin_dispatch_missing (const value_list_t *vl) /* {{{ */ cf = le->value; callback = cf->cf_callback; - status = (*callback) (vl); + status = (*callback) (vl, &cf->cf_udata); if (status != 0) { if (status < 0) @@ -1525,9 +1535,6 @@ int plugin_dispatch_values (value_list_t *vl) /* Update the value cache */ uc_update (ds, vl); - /* Initiate threshold checking */ - ut_check_threshold (ds, vl); - if (post_cache_chain != NULL) { status = fc_process_chain (ds, vl, post_cache_chain);