diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y index af82e5bd..5c4b5bef 100644 --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@ -50,9 +50,12 @@ log_limit: log_file: text log_limit { - this_log->rf = rf_open(new_config->pool, $1, "a"); - if (!this_log->rf) cf_error("Unable to open log file '%s': %m", $1); - this_log->fh = rf_file(this_log->rf); + if (!parse_and_exit) + { + this_log->rf = rf_open(new_config->pool, $1, "a"); + if (!this_log->rf) cf_error("Unable to open log file '%s': %m", $1); + this_log->fh = rf_file(this_log->rf); + } this_log->pos = -1; this_log->filename = $1; } @@ -88,9 +91,12 @@ conf: mrtdump_base ; mrtdump_base: MRTDUMP PROTOCOLS mrtdump_mask ';' { new_config->proto_default_mrtdump = $3; } | MRTDUMP text ';' { - struct rfile *f = rf_open(new_config->pool, $2, "a"); - if (!f) cf_error("Unable to open MRTDump file '%s': %m", $2); - new_config->mrtdump_file = rf_fileno(f); + if (!parse_and_exit) + { + struct rfile *f = rf_open(new_config->pool, $2, "a"); + if (!f) cf_error("Unable to open MRTDump file '%s': %m", $2); + new_config->mrtdump_file = rf_fileno(f); + } } ; diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 1d258f4c..2c7e3cef 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -658,7 +658,7 @@ signal_init(void) */ static char *opt_list = "bc:dD:ps:P:u:g:flRh"; -static int parse_and_exit; +int parse_and_exit; char *bird_name; static char *use_user; static char *use_group; diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h index 8244fc86..0f2973f0 100644 --- a/sysdep/unix/unix.h +++ b/sysdep/unix/unix.h @@ -20,6 +20,7 @@ struct rfile; /* main.c */ extern char *bird_name; +extern int parse_and_exit; void async_config(void); void async_dump(void); void async_shutdown(void);