From 97e46d28fff1aa27d7d15e113cc3a52ae20934c7 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 17 Mar 2010 12:19:22 +0100 Subject: Adds check for no protocol and some minor CLI fixes. - Adds check to deny config file with no specified protocol to prevent loading of empty config file. - Moves CLI init before config parse to receive immediate error message when cannot open control socket. - Fixes socket name path check and other error handling in CLI init. --- sysdep/unix/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sysdep/unix/main.c') diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 2245692..e0e0d63 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -298,8 +298,7 @@ cli_init_unix(void) s->type = SK_UNIX_PASSIVE; s->rx_hook = cli_connect; s->rbsize = 1024; - if (sk_open_unix(s, path_control_socket) < 0) - die("Unable to create control socket %s", path_control_socket); + sk_open_unix(s, path_control_socket); } /* @@ -457,6 +456,9 @@ main(int argc, char **argv) rt_init(); if_init(); + if (!parse_and_exit) + cli_init_unix(); + protos_build(); proto_build(&proto_unix_kernel); proto_build(&proto_unix_iface); @@ -483,8 +485,6 @@ main(int argc, char **argv) signal_init(); - cli_init_unix(); - #ifdef LOCAL_DEBUG async_dump_flag = 1; #endif -- cgit v1.2.3