From 0543006c11cd6e092e390b203dac1dcc8b26fd06 Mon Sep 17 00:00:00 2001 From: paulo Date: Thu, 21 Jan 2010 14:53:26 +0000 Subject: 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. --- lib/command.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/command.c') 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) -- cgit v1.2.3