diff options
author | David Lamparter <equinox@diac24.net> | 2021-02-04 22:27:11 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2021-02-12 19:29:36 +0100 |
commit | b6bc1ee8d363d61addd4c36ace693d5b795347d8 (patch) | |
tree | ba64acc34f153aaa93b050f0eb0491efd7c130fb /lib/vty.c | |
parent | lib: have a lib_privs for ... lib privs (diff) | |
download | frr-b6bc1ee8d363d61addd4c36ace693d5b795347d8.tar.xz frr-b6bc1ee8d363d61addd4c36ace693d5b795347d8.zip |
lib: de-uglify `-t` option + `log stdout` combo
The logging code writes log messages with a `\n` line ending, meanwhile
the VTY code switches it so you need `\r\n`...
And we don't flush the newline after executing a command either.
After this patch, starting daemons like `zebra/zebra -t` should provide
a nice development/debugging experience with a VTY open right there on
stdio and `log stdout` interspersed.
(This is already documented in the man pages, it just looked like sh*t
previously since the log messages didn't newline correctly.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to '')
-rw-r--r-- | lib/vty.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1470,6 +1470,7 @@ static int vty_read(struct thread *thread) case '\n': case '\r': vty_out(vty, "\n"); + buffer_flush_available(vty->obuf, vty_sock); vty_execute(vty); break; case '\t': @@ -1714,7 +1715,6 @@ void vty_stdio_resume(void) termios = stdio_orig_termios; termios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); - termios.c_oflag &= ~OPOST; termios.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN); termios.c_cflag &= ~(CSIZE | PARENB); termios.c_cflag |= CS8; |