]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: initialize vty structure correctly for output to terminal
authorChristian Franke <chris@opensourcerouting.org>
Mon, 5 Mar 2018 23:46:01 +0000 (00:46 +0100)
committerChristian Franke <chris@opensourcerouting.org>
Tue, 6 Mar 2018 00:29:17 +0000 (01:29 +0100)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
vtysh/vtysh.c
vtysh/vtysh_config.c

index 99140fd019e40304d57ef7297939fecc48f87d71..a28eff823296f4b5271508b518f41c0bf0a0b223 100644 (file)
@@ -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;
 
index 138a4463212d684b91b44ebad3bc2c520caf363b..22cedb572bcba55c284646fe1889bac3d04e77f1 100644 (file)
@@ -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;