summaryrefslogtreecommitdiffstats
path: root/lib/command.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/command.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/command.c')
-rw-r--r--lib/command.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/command.c b/lib/command.c
index 574e45bf..59cbbe52 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2298,10 +2298,11 @@ cmd_execute_command_strict (vector vline, struct vty *vty,
/* Configration make from file. */
int
-config_from_file (struct vty *vty, FILE *fp)
+config_from_file (struct vty *vty, FILE *fp, void (*after_first_cmd)(void))
{
int ret;
vector vline;
+ int first_cmd = 1;
while (fgets (vty->buf, VTY_BUFSIZ, fp))
{
@@ -2313,6 +2314,13 @@ config_from_file (struct vty *vty, FILE *fp)
/* Execute configuration command : this is strict match */
ret = cmd_execute_command_strict (vline, vty, NULL);
+ /* special handling for after the first command */
+ if (first_cmd && after_first_cmd)
+ {
+ after_first_cmd();
+ first_cmd = 0;
+ }
+
/* Try again with setting node to CONFIG_NODE */
while (ret != CMD_SUCCESS && ret != CMD_WARNING
&& ret != CMD_ERR_NOTHING_TODO && vty_get_node(vty) != CONFIG_NODE)