summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3bfada)
raw | patch | inline | side by side (parent: e3bfada)
author | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Thu, 12 Jun 2008 14:08:58 +0000 (16:08 +0200) | ||
committer | Florian Forster <sifnfors@informatik.stud.uni-erlangen.de> | |
Thu, 12 Jun 2008 14:08:58 +0000 (16:08 +0200) |
src/exec.c | patch | blob | history |
diff --git a/src/exec.c b/src/exec.c
index ac0175cf340a3eb04c3ca8d7175cb6155f755b03..5f9d6ad290bef18369139b9c3630776567041108 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
static void *exec_notification_one (void *arg) /* {{{ */
{
program_list_t *pl = ((program_list_and_notification_t *) arg)->pl;
- const notification_t *n = &((program_list_and_notification_t *) arg)->n;
+ notification_t *n = &((program_list_and_notification_t *) arg)->n;
+ notification_meta_t *meta;
int fd;
FILE *fh;
int pid;
if (strlen (n->type_instance) > 0)
fprintf (fh, "TypeInstance: %s\n", n->type_instance);
+ for (meta = n->meta; meta != NULL; meta = meta->next)
+ {
+ if (meta->type == NM_TYPE_STRING)
+ fprintf (fh, "%s: %s\n", meta->name, meta->value_string);
+ else if (meta->type == NM_TYPE_SIGNED_INT)
+ fprintf (fh, "%s: %lli\n", meta->name, meta->value_signed_int);
+ else if (meta->type == NM_TYPE_UNSIGNED_INT)
+ fprintf (fh, "%s: %llu\n", meta->name, meta->value_unsigned_int);
+ else if (meta->type == NM_TYPE_DOUBLE)
+ fprintf (fh, "%s: %e\n", meta->name, meta->value_double);
+ else if (meta->type == NM_TYPE_BOOLEAN)
+ fprintf (fh, "%s: %s\n", meta->name,
+ meta->value_boolean ? "true" : "false");
+ }
+
fprintf (fh, "\n%s\n", n->message);
fflush (fh);
DEBUG ("exec plugin: Child %i exited with status %i.",
pid, status);
+ plugin_notification_meta_free (n);
sfree (arg);
pthread_exit ((void *) 0);
return (NULL);
pln->pl = pl;
memcpy (&pln->n, n, sizeof (notification_t));
+ plugin_notification_meta_copy (&pln->n, n);
pthread_attr_init (&attr);
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);