From 55d24e7f3dbc69db37781dbff325bda0779778df Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 5 Feb 2010 09:48:45 +0100 Subject: lib: get rid of extraneous output with vty_prepend the vty_*prepend* family can be used to reduce the amount of output produced by "show running-config" and "write ...". it buffers output in struct vty->prepend (1024 bytes) and outputs it when vty_out is called. if vty_out isn't called, it can be removed with vty_unprepend later. applied on zebra and ospfd to get rid of empty interface blocks. --- ospfd/ospf_vty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ospfd/ospf_vty.c') diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index d024a2ac..c81d18d6 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -7431,8 +7431,8 @@ config_write_interface (struct vty *vty) if (memcmp (ifp->name, "VLINK", 5) == 0) continue; - vty_out (vty, "!%s", VTY_NEWLINE); - vty_out (vty, "interface %s%s", ifp->name, + vty_prepend (vty, "!%s", VTY_NEWLINE); + vty_prepend (vty, "interface %s%s", ifp->name, VTY_NEWLINE); if (ifp->desc) vty_out (vty, " description %s%s", ifp->desc, @@ -7613,6 +7613,7 @@ config_write_interface (struct vty *vty) #ifdef HAVE_OPAQUE_LSA ospf_opaque_config_write_if (vty, ifp); #endif /* HAVE_OPAQUE_LSA */ + vty_unprepend (vty); } return write; -- cgit v1.2.3