From eeda1184fa60c5077c2d404d0a8415d11e836ccd Mon Sep 17 00:00:00 2001 From: paulo Date: Fri, 22 Jan 2010 18:04:18 +0000 Subject: Fix "write file" command so reports "threaded". Working on Shutdown and HUP. Shutdown needs mechanism to know when bgp_engine has closed everything. HUP don't understand how it is supposed to cope with added/ deleted/retained peers and get them going again. --- lib/vty.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/vty.c') diff --git a/lib/vty.c b/lib/vty.c index e651e445..fdc36925 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -603,7 +603,8 @@ vty_queued_result(struct vty *vty, int result) if (cli_nexus) { vty_event (VTY_WRITE, vty->fd, vty); - qpt_thread_signal(cli_nexus->thread_id, SIGMQUEUE); + if (qpthreads_enabled) + qpt_thread_signal(cli_nexus->thread_id, SIGMQUEUE); } UNLOCK @@ -2901,15 +2902,18 @@ vty_goodbye (void) if (vtyvec) { for (i = 0; i < vector_active (vtyvec); i++) - if (((vty = vector_slot (vtyvec, i)) != NULL) && vty->type == VTY_TERM) - uty_out(vty, QUAGGA_PROGNAME " is shutting down%s", VTY_NEWLINE); - - /* Wake up */ - if (cli_nexus) { - vty_event (VTY_WRITE, vty->fd, vty); - qpt_thread_signal(cli_nexus->thread_id, SIGMQUEUE); + if (((vty = vector_slot (vtyvec, i)) != NULL) && vty->type == VTY_TERM) + { + uty_out(vty, QUAGGA_PROGNAME " is shutting down%s", VTY_NEWLINE); + + /* Wake up */ + if (cli_nexus) + vty_event (VTY_WRITE, vty->fd, vty); + } } + if (qpthreads_enabled) + qpt_thread_signal(cli_nexus->thread_id, SIGMQUEUE); } UNLOCK -- cgit v1.2.3