X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fexec.c;h=1f8a9ac0ebfb4a7ccfb933192368630c63cd3844;hb=7f71f1b7a38d7b50af44f403b79aa034b3882f2a;hp=c2d42ee0bbcc19f4268ab568ea45971ba70b92df;hpb=c57f2a191b63ce73fc432befebe9fa3af97c8eb5;p=collectd.git diff --git a/src/exec.c b/src/exec.c index c2d42ee0..1f8a9ac0 100644 --- a/src/exec.c +++ b/src/exec.c @@ -1,6 +1,8 @@ /** * collectd - src/exec.c - * Copyright (C) 2007,2008 Florian octo Forster + * Copyright (C) 2007-2009 Florian octo Forster + * Copyright (C) 2007-2009 Sebastian Harl + * Copyright (C) 2008 Peter Holik * * 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 @@ -17,8 +19,12 @@ * * Authors: * Florian octo Forster + * Sebastian Harl + * Peter Holik **/ +#define _BSD_SOURCE /* For setgroups */ + #include "collectd.h" #include "common.h" #include "plugin.h" @@ -724,7 +730,8 @@ static void *exec_notification_one (void *arg) /* {{{ */ DEBUG ("exec plugin: Child %i exited with status %i.", pid, status); - plugin_notification_meta_free (n->meta); + if (n->meta != NULL) + plugin_notification_meta_free (n->meta); n->meta = NULL; sfree (arg); pthread_exit ((void *) 0); @@ -773,7 +780,8 @@ static int exec_read (void) /* {{{ */ return (0); } /* int exec_read }}} */ -static int exec_notification (const notification_t *n) +static int exec_notification (const notification_t *n, + user_data_t __attribute__((unused)) *user_data) { program_list_t *pl; program_list_and_notification_t *pln; @@ -813,7 +821,7 @@ static int exec_notification (const notification_t *n) } /* for (pl) */ return (0); -} /* int exec_notification */ +} /* }}} int exec_notification */ static int exec_shutdown (void) /* {{{ */ { @@ -846,7 +854,8 @@ void module_register (void) plugin_register_complex_config ("exec", exec_config); plugin_register_init ("exec", exec_init); plugin_register_read ("exec", exec_read); - plugin_register_notification ("exec", exec_notification); + plugin_register_notification ("exec", exec_notification, + /* user_data = */ NULL); plugin_register_shutdown ("exec", exec_shutdown); } /* void module_register */