diff options
author | David Lamparter <equinox@diac24.net> | 2010-02-05 09:48:45 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-05 09:51:24 +0100 |
commit | 55d24e7f3dbc69db37781dbff325bda0779778df (patch) | |
tree | a2b2525677332fd92ccc66a4c6082c620ba27802 /zebra/interface.c | |
parent | 647e8e064d8e5316fc89587714a056b1240fa298 (diff) | |
download | quagga-55d24e7f3dbc69db37781dbff325bda0779778df.tar.bz2 quagga-55d24e7f3dbc69db37781dbff325bda0779778df.tar.xz |
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.
Diffstat (limited to 'zebra/interface.c')
-rw-r--r-- | zebra/interface.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index e09ca41f..f385f8e6 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1699,7 +1699,7 @@ if_config_write (struct vty *vty) if_data = ifp->info; - vty_out (vty, "interface %s%s", ifp->name, + vty_prepend (vty, "interface %s%s", ifp->name, VTY_NEWLINE); if (ifp->desc) @@ -1764,7 +1764,9 @@ if_config_write (struct vty *vty) irdp_config_write (vty, ifp); #endif /* IRDP */ - vty_out (vty, "!%s", VTY_NEWLINE); + if (!vty_prepending (vty)) + vty_out (vty, "!%s", VTY_NEWLINE); + vty_unprepend (vty); } return 0; } |