summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_main.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2009-10-14 18:13:29 +0200
committerDavid Lamparter <equinox@diac24.net>2010-02-04 02:53:48 +0100
commitac9ed56d887357049bae1bc901e80b58961d6380 (patch)
treea5cd31094ee55324fe6a57212c03c6f7828673c4 /ospfd/ospf_main.c
parentf99eea6053507e6dbd5ad22f4c7ba80c5a981651 (diff)
downloadquagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.bz2
quagga-ac9ed56d887357049bae1bc901e80b58961d6380.tar.xz
lib: fs namespacing 2/5: use path_state for vty paths
use the path_state helper functions for determining vty socket paths in all quagga daemons. this allows for running multiple daemons if a namespace name is set.
Diffstat (limited to 'ospfd/ospf_main.c')
-rw-r--r--ospfd/ospf_main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index 8b9a3458..30993aa3 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -72,7 +72,7 @@ struct zebra_privs_t ospfd_privs =
};
/* Configuration filename and directory. */
-char config_default[] = SYSCONFDIR OSPF_DEFAULT_CONFIG;
+char config_default[MAXPATHLEN];
/* OSPFd options. */
struct option longopts[] =
@@ -96,8 +96,11 @@ struct option longopts[] =
/* Master of threads. */
struct thread_master *master;
+/* pid_file default value */
+static char pid_file_default[MAXPATHLEN];
+
/* Process ID saved for use by init system */
-const char *pid_file = PATH_OSPFD_PID;
+const char *pid_file = pid_file_default;
#ifdef SUPPORT_OSPF_API
extern int ospf_apiserver_enable;
@@ -274,6 +277,9 @@ main (int argc, char **argv)
}
}
+ strcpy (config_default, path_config (OSPF_CONFIG_NAME));
+ strcpy (pid_file_default, path_state (OSPF_PID_NAME));
+
/* Initializations. */
master = om->master;
@@ -324,7 +330,7 @@ main (int argc, char **argv)
pid_output (pid_file);
/* Create VTY socket */
- vty_serv_sock (vty_addr, vty_port, OSPF_VTYSH_PATH);
+ vty_serv_sock (vty_addr, vty_port, path_state (OSPF_VTY_NAME));
/* Print banner. */
zlog_notice ("OSPFd %s starting: vty@%d", QUAGGA_VERSION, vty_port);