static void *do_flush (void *arg)
{
INFO ("Flushing all data.");
- plugin_flush_all (-1);
+ plugin_flush (NULL, -1, NULL);
INFO ("Finished flushing all data.");
pthread_exit (NULL);
return NULL;
str = global_option_get ("Hostname");
if (str != NULL)
{
- strncpy (hostname_g, str, sizeof (hostname_g));
- hostname_g[sizeof (hostname_g) - 1] = '\0';
+ sstrncpy (hostname_g, str, sizeof (hostname_g));
return (0);
}
if (ai_ptr->ai_canonname == NULL)
continue;
- strncpy (hostname_g, ai_ptr->ai_canonname, sizeof (hostname_g));
- hostname_g[sizeof (hostname_g) - 1] = '\0';
+ sstrncpy (hostname_g, ai_ptr->ai_canonname, sizeof (hostname_g));
break;
}
struct sigaction sig_int_action;
struct sigaction sig_term_action;
struct sigaction sig_usr1_action;
+ struct sigaction sig_pipe_action;
char *configfile = CONFIGFILE;
int test_config = 0;
const char *basedir;
#if COLLECT_DAEMON
- struct sigaction sigChldAction;
+ struct sigaction sig_chld_action;
pid_t pid;
int daemonize = 1;
#endif
/*
* fork off child
*/
- memset (&sigChldAction, '\0', sizeof (sigChldAction));
- sigChldAction.sa_handler = SIG_IGN;
- sigaction (SIGCHLD, &sigChldAction, NULL);
+ memset (&sig_chld_action, '\0', sizeof (sig_chld_action));
+ sig_chld_action.sa_handler = SIG_IGN;
+ sigaction (SIGCHLD, &sig_chld_action, NULL);
if (daemonize)
{
} /* if (daemonize) */
#endif /* COLLECT_DAEMON */
+ memset (&sig_pipe_action, '\0', sizeof (sig_pipe_action));
+ sig_pipe_action.sa_handler = SIG_IGN;
+ sigaction (SIGPIPE, &sig_pipe_action, NULL);
+
/*
* install signal handlers
*/