diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2017-06-01 16:02:23 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2017-08-02 02:59:51 +0200 |
| commit | 154b9e8f9f08f5be2d3d84f7565e3ce7921b8b35 (patch) | |
| tree | 8604dc623700f77649eb13eee3822e08ad1a7302 /lib/grammar_sandbox_main.c | |
| parent | cff2b2112e493ac875f1cc31ae0df4f1c13e4a90 (diff) | |
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 'lib/grammar_sandbox_main.c')
| -rw-r--r-- | lib/grammar_sandbox_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c index c236d2c7be..89b0993d1d 100644 --- a/lib/grammar_sandbox_main.c +++ b/lib/grammar_sandbox_main.c @@ -26,10 +26,11 @@ #include "command.h" #include "memory_vty.h" -static void vty_do_exit(void) +static void vty_do_exit(int isexit) { printf("\nend.\n"); - exit(0); + if (!isexit) + exit(0); } struct thread_master *master; |
