Merge pull request #2806 from opensourcerouting/vty-term-fd

lib: fix "-t" command line option
This commit is contained in:
Quentin Young 2018-08-09 12:43:02 -04:00 committed by GitHub
commit 7a07a176cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2303,9 +2303,9 @@ void vty_close(struct vty *vty)
* additionally, we'd need to replace these fds with /dev/null. */ * additionally, we'd need to replace these fds with /dev/null. */
if (vty->wfd > STDERR_FILENO && vty->wfd != vty->fd) if (vty->wfd > STDERR_FILENO && vty->wfd != vty->fd)
close(vty->wfd); close(vty->wfd);
if (vty->fd > STDERR_FILENO) { if (vty->fd > STDERR_FILENO)
close(vty->fd); close(vty->fd);
} else if (vty->fd == STDIN_FILENO)
was_stdio = true; was_stdio = true;
if (vty->buf) if (vty->buf)