summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorpaulo <paul@bayleaf.org.uk>2010-01-21 14:53:26 +0000
committerpaulo <paul@bayleaf.org.uk>2010-01-21 14:53:26 +0000
commit0543006c11cd6e092e390b203dac1dcc8b26fd06 (patch)
tree22b7ba595a1bc472775e032263529741986408d7 /lib/vty.c
parent305c1b3dd35748bc949a139ce8db03f7f5552cde (diff)
downloadquagga-0543006c11cd6e092e390b203dac1dcc8b26fd06.tar.bz2
quagga-0543006c11cd6e092e390b203dac1dcc8b26fd06.tar.xz
Fixes to get 3 threads working. Fixes to get threaded command working.
Removed some of the temporary debuggery in qtimers that only worked in 1 thread. Initialised the mqueue mutex. Stopped peer_index from zeroizing its mutex after it had been initialized.
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 4797f923..e651e445 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2649,7 +2649,7 @@ uty_timeout (struct vty *vty)
/* Read up configuration file from file_name. */
static void
-vty_read_file (FILE *confp)
+vty_read_file (FILE *confp, void (*after_first_cmd)(void))
{
int ret;
struct vty *vty;
@@ -2658,7 +2658,7 @@ vty_read_file (FILE *confp)
vty->node = CONFIG_NODE;
/* Execute configuration file */
- ret = config_from_file (vty, confp);
+ ret = config_from_file (vty, confp, after_first_cmd);
LOCK
@@ -2752,6 +2752,15 @@ void
vty_read_config (char *config_file,
char *config_default_dir)
{
+ vty_read_config_first_cmd_special(config_file, config_default_dir, NULL);
+}
+
+/* Read up configuration file from file_name.
+ * callback after first command */
+void
+vty_read_config_first_cmd_special(char *config_file,
+ char *config_default_dir, void (*after_first_cmd)(void))
+{
char cwd[MAXPATHLEN];
FILE *confp = NULL;
char *fullpath;
@@ -2840,7 +2849,7 @@ vty_read_config (char *config_file,
fullpath = config_default_dir;
}
- vty_read_file (confp);
+ vty_read_file (confp, after_first_cmd);
fclose (confp);
@@ -3087,6 +3096,8 @@ vty_event_r (enum event event, int sock, struct vty *vty)
qps_enable_mode(vty->qf, qps_write_mnum, vty_flush_r) ;
break;
case VTY_TIMEOUT_RESET:
+ if (vty->qtr == NULL)
+ break;
if (vty->v_timeout)
{
qtimer_set(vty->qtr, qt_add_monotonic(QTIME(vty->v_timeout)), NULL) ;