summaryrefslogtreecommitdiffstats
path: root/ulogd/ulogd.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-05-28 12:46:38 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-05-28 12:46:38 +0000
commitad922a36f5c5f92568055062b88d569928a27834 (patch)
tree172597ad35bc45f5b5d82244c70e6aeea69ddfcf /ulogd/ulogd.c
parenta04029553ce3bfbae039becebaef04a0ea0ae1ab (diff)
Patches from Marius Tomaschewski <mt@suse.de>:
- Fixed sigterm_handler to close logfile and then call output_plugin->fini. The output_plugin->fini function may still use the logger (e.g. sqlite3 does), what causes a SEGV (really happens in case of sqlite3 db init error - as far as I remember) - Changed sighup_handler_print to not to call exit(2) on reopen failure, but try to reopen and fallback to continue using old descriptor on failure. - Fixed mac output in ulogd_BASE.c - Added explicit termination of the hostname buffer: "[...] if namelen is an insufficient length to hold the host name, then the returned name is truncated and it is unspecified whether the returned name is null-terminated. [...]" as SUSv2 specifies. - Added to print "\n" after ULOGD_RET_NONE type as well after an unspecified type. See example above at extensions/ulogd_BASE.c. - Fixed to set the '\0' at the end and not behind the buffer.
Diffstat (limited to 'ulogd/ulogd.c')
-rw-r--r--ulogd/ulogd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ulogd/ulogd.c b/ulogd/ulogd.c
index 9324a4f..5707ef8 100644
--- a/ulogd/ulogd.c
+++ b/ulogd/ulogd.c
@@ -595,14 +595,15 @@ static void sigterm_handler(int signal)
ipulog_destroy_handle(libulog_h);
free(libulog_buf);
- if (logfile != stdout && logfile != &syslog_dummy)
- fclose(logfile);
for (p = ulogd_outputs; p; p = p->next) {
if (p->fini)
(*p->fini)();
}
+ if (logfile != stdout && logfile != &syslog_dummy)
+ fclose(logfile);
+
exit(0);
}