summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-01 16:02:23 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-02 02:59:51 +0200
commit154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35 (patch)
tree8604dc623700f77649eb13eee3822e08ad1a7302 /tests
parentlib: --terminal option for all daemons (diff)
downloadfrr-154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35.tar.xz
frr-154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35.zip
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 <equinox@opensourcerouting.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/cli/common_cli.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/lib/cli/common_cli.c b/tests/lib/cli/common_cli.c
index b6df6d3b8..77f1610fe 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. */