From 9c99076cf33bfa874db34151e28822f0e392ab3a Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Tue, 29 Mar 2011 19:47:32 +0100 Subject: Fix compile on older gcc, and other minor fixes. Slightly older gcc would not tolerate an offsetof() where the type part contained a '->' -- replaced foo->bar by foo[0].bar, which is more readily tolerated. Fixed assert() in "--more--". Improved some shut-down code. --- lib/vty_command.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/vty_command.c') 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: * -- cgit v1.2.3