diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-11-19 11:44:17 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-11-19 11:44:17 +0100 |
commit | a4644ed6ab32c098b755bdac03498634b2794409 (patch) | |
tree | 6b705b7ad27b61a9416d711e6c9fb3127aa1e612 /sysdep | |
parent | 3f9b7bfe9ff050430a5886b22a5ab11b5f253048 (diff) | |
download | bird-a4644ed6ab32c098b755bdac03498634b2794409.tar bird-a4644ed6ab32c098b755bdac03498634b2794409.zip |
Implement option to exit after config file parsing.
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/unix/main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 5e4aa97..533754e 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -365,7 +365,7 @@ signal_init(void) * Parsing of command-line arguments */ -static char *opt_list = "c:dD:s:"; +static char *opt_list = "c:dD:ps:"; static void usage(void) @@ -374,6 +374,8 @@ usage(void) exit(1); } +int parse_and_exit; + static void parse_args(int argc, char **argv) { @@ -402,6 +404,9 @@ parse_args(int argc, char **argv) log_init_debug(optarg); debug_flag |= 2; break; + case 'p': + parse_and_exit = 1; + break; case 's': path_control_socket = optarg; break; @@ -444,6 +449,9 @@ main(int argc, char **argv) read_config(); + if (parse_and_exit) + exit(0); + if (!debug_flag) { pid_t pid = fork(); |