summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-11-26 23:23:29 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-11-26 23:23:29 +0100
commita6250a7d1013442ad4feb0d67128a707f2c6880b (patch)
tree4c9ded0ae0d846aed88ff853d882ee389d65aa2a
parentbf47fe4b2e40ccfcfe6af2d86548d06cdf9739c5 (diff)
downloadbird-a6250a7d1013442ad4feb0d67128a707f2c6880b.tar
bird-a6250a7d1013442ad4feb0d67128a707f2c6880b.zip
Fix -p option.
-rw-r--r--doc/bird.sgml3
-rw-r--r--sysdep/unix/main.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/doc/bird.sgml b/doc/bird.sgml
index d08b0c1..1f494cc 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.
<tag>-p</tag>
- 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.
<tag>-s <m/name of communication socket/</tag>
use given filename for a socket for communications with the client, default is <it/prefix/<file>/var/run/bird.ctl</file>.
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 533754e..6107b22 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 <config-file>] [-d] [-D <debug-file>] [-s <control-socket>]\n");
+ fprintf(stderr, "Usage: bird [-c <config-file>] [-d] [-D <debug-file>] [-p] [-s <control-socket>]\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();