summaryrefslogtreecommitdiffstats
path: root/sysdep/unix/main.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-03-17 12:19:22 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2010-03-17 12:19:22 +0100
commit97e46d28fff1aa27d7d15e113cc3a52ae20934c7 (patch)
tree22f8466422eec5f2759a7263f7359f7b0b11abcc /sysdep/unix/main.c
parent4e3bfd9006ba3033a814a392f9bf4bbca060c8a9 (diff)
downloadbird-97e46d28fff1aa27d7d15e113cc3a52ae20934c7.tar
bird-97e46d28fff1aa27d7d15e113cc3a52ae20934c7.zip
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.
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r--sysdep/unix/main.c8
1 files changed, 4 insertions, 4 deletions
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