From a6250a7d1013442ad4feb0d67128a707f2c6880b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 26 Nov 2009 23:23:29 +0100 Subject: [PATCH] Fix -p option. --- doc/bird.sgml | 3 ++- sysdep/unix/main.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index d08b0c17..1f494cce 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -132,7 +132,8 @@ options. The most important ones are: log debugging information to given file instead of stderr. -p - just parse the config file and exit. + just parse the config file and exit. Return value is zero if the config file is valid, + nonzero if there are some errors. -s use given filename for a socket for communications with the client, default is /var/run/bird.ctl. diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 533754ea..6107b226 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -370,7 +370,7 @@ static char *opt_list = "c:dD:ps:"; static void usage(void) { - fprintf(stderr, "Usage: bird [-c ] [-d] [-D ] [-s ]\n"); + fprintf(stderr, "Usage: bird [-c ] [-d] [-D ] [-p] [-s ]\n"); exit(1); } @@ -434,7 +434,8 @@ main(int argc, char **argv) log_init_debug(""); log_init(debug_flag, 1); - test_old_bird(path_control_socket); + if (!parse_and_exit) + test_old_bird(path_control_socket); DBG("Initializing.\n"); resource_init();