summaryrefslogtreecommitdiff
path: root/vtysh/vtysh_main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-11-13 17:48:56 +0900
committerDavid Lamparter <equinox@opensourcerouting.org>2017-03-08 00:15:36 +0100
commiteb05883f3ecd94be017eb7d15181a989f26541ee (patch)
treef3de680c33e3af0f95520eadf8fb0060dc1ee76c /vtysh/vtysh_main.c
parent857b5446497505f582417e4a5ada029712743cbc (diff)
*: add frr_config_fork()
Centralise read_config/daemonize/dryrun/pidfile/vty_serv into libfrr. This also makes multi-instance pid/config handling available as part of the library. It's only wired up in ospfd, but the code is in lib/. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh/vtysh_main.c')
-rw-r--r--vtysh/vtysh_main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 3dffa05ace..bf62850e22 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -37,6 +37,7 @@
#include "memory.h"
#include "linklist.h"
#include "memory_vty.h"
+#include "libfrr.h"
#include "vtysh/vtysh.h"
#include "vtysh/vtysh_user.h"
@@ -54,7 +55,7 @@ char history_file[MAXPATHLEN];
int execute_flag = 0;
/* VTY Socket prefix */
-char * vty_sock_path = NULL;
+const char * vty_sock_path = NULL;
/* For sigsetjmp() & siglongjmp(). */
static sigjmp_buf jmpbuf;
@@ -402,6 +403,9 @@ main (int argc, char **argv, char **env)
}
}
+ if (!vty_sock_path)
+ vty_sock_path = frr_vtydir;
+
if (markfile + writeconfig + dryrun + boot_flag > 1)
{
fprintf (stderr, "Invalid combination of arguments. Please specify at "