diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2018-08-08 20:52:15 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2018-08-08 20:53:27 +0200 |
commit | 572e26445a84ebaeeb3d6b2e1d908b4050f44516 (patch) | |
tree | 12b04deda7fe3cee8f1501e71a2fa1ef949930d3 | |
parent | Merge pull request #2122 from donaldsharp/zebra_nhs (diff) | |
download | frr-572e26445a84ebaeeb3d6b2e1d908b4050f44516.tar.xz frr-572e26445a84ebaeeb3d6b2e1d908b4050f44516.zip |
lib: fix "-t" command line option
was_stdio was getting set for fd == -1 (config file read), thus
prematurely closing the stdio vty.
Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r-- | lib/vty.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2303,9 +2303,9 @@ void vty_close(struct vty *vty) * additionally, we'd need to replace these fds with /dev/null. */ if (vty->wfd > STDERR_FILENO && vty->wfd != vty->fd) close(vty->wfd); - if (vty->fd > STDERR_FILENO) { + if (vty->fd > STDERR_FILENO) close(vty->fd); - } else + if (vty->fd == STDIN_FILENO) was_stdio = true; if (vty->buf) |