From 154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 1 Jun 2017 16:02:23 +0200 Subject: lib: vty_stdio signal handling - SIGTSTP appropriately suspends the foreground terminal - SIGINT causes the daemon to exit, regardless of -d - SIGQUIT causes the daemon to daemonize, regardless of -d Signed-off-by: David Lamparter --- tests/lib/cli/common_cli.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/lib/cli/common_cli.c') diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c index b6df6d3b8d..77f1610fe2 100644 --- a/tests/lib/cli/common_cli.c +++ b/tests/lib/cli/common_cli.c @@ -45,7 +45,7 @@ int dump_args(struct vty *vty, const char *descr, int argc, return CMD_SUCCESS; } -static void vty_do_exit(void) +static void vty_do_exit(int isexit) { printf("\nend.\n"); cmd_terminate(); @@ -54,7 +54,8 @@ static void vty_do_exit(void) closezlog(); log_memstats_stderr("testcli"); - exit(0); + if (!isexit) + exit(0); } /* main routine. */ -- cgit v1.2.3