From 7713f82b6236b1bacfaf00e5d22f6c93c3494acb Mon Sep 17 00:00:00 2001 From: Daniel Roethlisberger Date: Wed, 17 Oct 2012 00:24:26 +0200 Subject: [PATCH] Move more log writes after log initialization --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index 21a3555..7633498 100644 --- a/main.c +++ b/main.c @@ -606,21 +606,21 @@ main(int argc, char *argv[]) log_err_mode(LOG_ERR_MODE_SYSLOG); ssl_reinit(); } + + /* Post-privdrop/chroot/detach initialization, thread spawning */ + if (log_init(opts) == -1) { + log_err_printf("Failed to init log facility.\n"); + exit(EXIT_FAILURE); + } if (opts->pidfile && (sys_pidf_write(pidfd) == -1)) { log_err_printf("Failed to write PID to PID file '%s': %s\n", opts->pidfile, strerror(errno)); exit(EXIT_FAILURE); } - - /* Post-privdrop/chroot/detach initialization, thread spawning */ if (cachemgr_init() == -1) { log_err_printf("Failed to init cache manager.\n"); exit(EXIT_FAILURE); } - if (log_init(opts) == -1) { - log_err_printf("Failed to init log facility.\n"); - exit(EXIT_FAILURE); - } if (nat_init() == -1) { log_err_printf("Failed to init NAT state table lookup.\n"); exit(EXIT_FAILURE);