summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb9f56e)
raw | patch | inline | side by side (parent: fb9f56e)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 23 Feb 2009 14:36:40 +0000 (15:36 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 23 Feb 2009 14:36:40 +0000 (15:36 +0100) |
src/plugin.c | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 4e35bf2ba56e584dd908e53f2ba12681ca285d8a..856ec1a01f89fbddadf744b81b7b31d5d202345b 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
int plugin_dispatch_notification (const notification_t *notif)
{
- int (*callback) (const notification_t *);
llentry_t *le;
/* Possible TODO: Add flap detection here */
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;
}