From 4a9746fdd0507a7552121072d6f06c7e78a10c63 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 6 Mar 2018 00:46:01 +0100 Subject: [PATCH] vtysh: initialize vty structure correctly for output to terminal Signed-off-by: Christian Franke --- vtysh/vtysh.c | 2 +- vtysh/vtysh_config.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 8719226281..bf9d70bae9 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -539,7 +539,7 @@ int vtysh_mark_file(const char *filename) } vty = vty_new(); - vty->fd = 0; /* stdout */ + vty->wfd = STDERR_FILENO; vty->type = VTY_TERM; vty->node = CONFIG_NODE; diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index aa1dd407eb..3658128b1c 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -398,7 +398,7 @@ static int vtysh_read_file(FILE *confp) int ret; vty = vty_new(); - vty->fd = 0; /* stdout */ + vty->wfd = STDERR_FILENO; vty->type = VTY_TERM; vty->node = CONFIG_NODE; -- 2.39.5