From 7e99399b51eb3e1512f3d85256585b908a143f88 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 99140fd019..a28eff8232 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 138a446321..22cedb572b 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -396,7 +396,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