diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-14 20:37:32 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-14 20:37:32 +0100 |
commit | 63542845dfb6d2277f93f77ad9ca3ad8bbaddd09 (patch) | |
tree | f65e7c59057a3db2bd80126ac5095d37a42fc2ce /sysdep/unix | |
parent | 34a877ccac25d38172716d3d2488449c870cad0b (diff) | |
parent | 8a7fb8858fa87bce6f2f15ee2bbb77704b5fff4e (diff) | |
download | bird-63542845dfb6d2277f93f77ad9ca3ad8bbaddd09.tar bird-63542845dfb6d2277f93f77ad9ca3ad8bbaddd09.zip |
Merge branch 'dev' into ospf3
Conflicts:
proto/ospf/lsreq.c
proto/ospf/lsupd.c
proto/ospf/rt.c
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/main.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 17845d2..6107b22 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -313,8 +313,9 @@ async_shutdown(void) void sysdep_shutdown_done(void) { - unlink(PATH_CONTROL_SOCKET); - die("System shutdown completed"); + unlink(path_control_socket); + log_msg(L_FATAL "System shutdown completed"); + exit(0); } /* @@ -364,15 +365,17 @@ 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) { - 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); } +int parse_and_exit; + static void parse_args(int argc, char **argv) { @@ -401,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; @@ -428,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(); @@ -443,6 +450,9 @@ main(int argc, char **argv) read_config(); + if (parse_and_exit) + exit(0); + if (!debug_flag) { pid_t pid = fork(); |