summaryrefslogtreecommitdiffstats
path: root/lib/vty_command.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty_command.c')
-rw-r--r--lib/vty_command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/vty_command.c b/lib/vty_command.c
index 9aebc50f..94ba6833 100644
--- a/lib/vty_command.c
+++ b/lib/vty_command.c
@@ -297,6 +297,7 @@ vty_cmd_loop_exit(vty vty)
uty_cmd_config_lock_check(vty, NULL_NODE) ;
/* Can now close the vty */
+ vty->vio->state = vc_stopped ;
uty_close(vty->vio, NULL, false) ; /* not curtains */
VTY_UNLOCK() ;
@@ -941,12 +942,16 @@ uty_cmd_hiatus(vty_io vio, cmd_return_code_t ret)
return ret ; /* <<< exit here on CMD_WAITING */
case CMD_EOF:
- case CMD_CLOSE:
uty_out_accept(vio) ; /* accept any buffered remarks. */
assert(vio->real_depth > 0) ;
--vio->real_depth ;
break ;
+ case CMD_CLOSE:
+ uty_out_accept(vio) ; /* accept any buffered remarks. */
+ vio->real_depth = 0 ; /* which it may already be */
+ break ;
+
default:
/* If not any of the above, must be an error of some kind:
*