From d3f36e5978e85a926c497e2aa2cbdf319776ebb5 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 13 Nov 2009 14:43:29 +0100 Subject: Fixes BIRD socket unlink. --- sysdep/unix/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 17845d2..75944c5 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -313,7 +313,7 @@ async_shutdown(void) void sysdep_shutdown_done(void) { - unlink(PATH_CONTROL_SOCKET); + unlink(path_control_socket); die("System shutdown completed"); } -- cgit v1.2.3 From 653b4015f137d9590147f8774ec686031696f81c Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 13 Nov 2009 14:54:43 +0100 Subject: After shutdown, BIRD should have exit code 0. --- sysdep/unix/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 75944c5..5e4aa97 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -314,7 +314,8 @@ void sysdep_shutdown_done(void) { unlink(path_control_socket); - die("System shutdown completed"); + log_msg(L_FATAL "System shutdown completed"); + exit(0); } /* -- cgit v1.2.3 From a4644ed6ab32c098b755bdac03498634b2794409 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 19 Nov 2009 11:44:17 +0100 Subject: Implement option to exit after config file parsing. --- sysdep/unix/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sysdep/unix') 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(); -- cgit v1.2.3 From a6250a7d1013442ad4feb0d67128a707f2c6880b Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 26 Nov 2009 23:23:29 +0100 Subject: Fix -p option. --- sysdep/unix/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sysdep/unix') 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 ] [-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(); -- cgit v1.2.3