summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a4ce0f)
raw | patch | inline | side by side (parent: 0a4ce0f)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 16 Feb 2009 11:02:09 +0000 (12:02 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 16 Feb 2009 14:22:04 +0000 (15:22 +0100) |
This is more flexible and allows the function to be used when using the meta
data without an embedding notification object, e.g. when using the filter
chains.
data without an embedding notification object, e.g. when using the filter
chains.
src/exec.c | patch | blob | history | |
src/perl.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history | |
src/utils_threshold.c | patch | blob | history |
diff --git a/src/exec.c b/src/exec.c
index 8add480e3e548c5e62dc0f37bf49ab6e6c45dd4a..973cd52b713c21277a7d27233fa000effccc79c0 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
DEBUG ("exec plugin: Child %i exited with status %i.",
pid, status);
- plugin_notification_meta_free (n);
+ plugin_notification_meta_free (n->meta);
+ n->meta = NULL;
sfree (arg);
pthread_exit ((void *) 0);
return (NULL);
diff --git a/src/perl.c b/src/perl.c
index efb8bdd6aa3db6f898b8e60b9f9f2ee4b109a14c..f9c993872a4ba5a12f43aa13167b740911efb662 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
}
if (0 != av2notification_meta (aTHX_ (AV *)SvRV (*tmp), &n->meta)) {
- plugin_notification_meta_free (n);
+ plugin_notification_meta_free (n->meta);
+ n->meta = NULL;
return -1;
}
break;
return -1;
ret = plugin_dispatch_notification (&n);
- plugin_notification_meta_free (&n);
+ plugin_notification_meta_free (n.meta);
return ret;
} /* static int pplugin_dispatch_notification (HV *) */
diff --git a/src/plugin.c b/src/plugin.c
index 61cc09c6251500c275ddee80582cd7bcbb8f7bab..9f42f2e42f41b354592a0a693b4f22f99943e326 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
return (0);
} /* int plugin_notification_meta_copy */
-int plugin_notification_meta_free (notification_t *n)
+int plugin_notification_meta_free (notification_meta_t *n)
{
notification_meta_t *this;
notification_meta_t *next;
return (-1);
}
- this = n->meta;
- n->meta = NULL;
+ this = n;
while (this != NULL)
{
next = this->next;
diff --git a/src/plugin.h b/src/plugin.h
index 2d9930175e68ceb9426562d86be8d6ecf3759c14..3088e06e6cb70bc7b6a659ae0dfec680a8b99cb1 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
int plugin_notification_meta_copy (notification_t *dst,
const notification_t *src);
-int plugin_notification_meta_free (notification_t *n);
+int plugin_notification_meta_free (notification_meta_t *n);
#endif /* PLUGIN_H */
diff --git a/src/utils_threshold.c b/src/utils_threshold.c
index 1b211385554b62ed8cec1bbc5f67aadbfb19a149..03a3f2d473907cc13fd44a3c6fdde5d99749e319 100644 (file)
--- a/src/utils_threshold.c
+++ b/src/utils_threshold.c
plugin_dispatch_notification (&n);
- plugin_notification_meta_free (&n);
+ plugin_notification_meta_free (n.meta);
return (0);
} /* }}} int ut_report_state */