From: Florian Forster Date: Mon, 23 Feb 2009 14:36:40 +0000 (+0100) Subject: src/plugin.c: Fix plugin_dispatch_notification again. X-Git-Tag: collectd-4.7.0~114^2~10 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c41ead0b33b4f3210c49591499ce8010172ae2cb;p=collectd.git src/plugin.c: Fix plugin_dispatch_notification again. --- diff --git a/src/plugin.c b/src/plugin.c index 4e35bf2b..856ec1a0 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1138,7 +1138,6 @@ int plugin_dispatch_values (value_list_t *vl) int plugin_dispatch_notification (const notification_t *notif) { - int (*callback) (const notification_t *); llentry_t *le; /* Possible TODO: Add flap detection here */ @@ -1154,8 +1153,19 @@ int plugin_dispatch_notification (const notification_t *notif) le = llist_head (list_notification); while (le != NULL) { - callback = (int (*) (const notification_t *)) le->value; - (*callback) (notif); + callback_func_t *cf; + plugin_notification_cb callback; + int status; + + cf = le->value; + callback = cf->cf_callback; + status = (*callback) (notif, &cf->cf_udata); + if (status != 0) + { + WARNING ("plugin_dispatch_notification: Notification " + "callback %s returned %i.", + le->key, status); + } le = le->next; }