summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2006-05-23 22:10:55 +0000
committerPaul Jakma <paul.jakma@sun.com>2006-05-23 22:10:55 +0000
commit4150f33ec17792c4258cb64de6128928ac104bf2 (patch)
tree164242e7896ffbd52205cce989afff56058b4e3e /vtysh
parentdbf7d13d06a9ab01e39afa1545b30808d5653341 (diff)
[vtysh] suppress output in 'show logging' for daemons not present
2006-05-21 Paul Jakma <paul.jakma@sun.com> * vtysh.c: (vtysh_show_logging_cmd) Suppress output for daemons which are not running (Andrew Schorr).
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/ChangeLog5
-rw-r--r--vtysh/vtysh.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/vtysh/ChangeLog b/vtysh/ChangeLog
index e4908b45..3ad1c252 100644
--- a/vtysh/ChangeLog
+++ b/vtysh/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-21 Paul Jakma <paul.jakma@sun.com>
+
+ * vtysh.c: (vtysh_show_logging_cmd) Suppress output for daemons
+ which are not running (Andrew Schorr).
+
2006-05-17 Paul Jakma <paul.jakma@sun.com>
* vtysh.c: (general) Add 'show logging' command.
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index a2115fae..2dbb5337 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1323,12 +1323,14 @@ DEFUN (vtysh_show_logging,
char line[] = "show logging\n";
for (i = 0; i < VTYSH_INDEX_MAX; i++)
- {
- fprintf (stdout,"Logging configuration for %s:\n", vtysh_client[i].name);
- ret = vtysh_client_execute (&vtysh_client[i], line, stdout);
- fprintf (stdout,"\n");
- }
-
+ if ( vtysh_client[i].fd >= 0 )
+ {
+ fprintf (stdout,"Logging configuration for %s:\n",
+ vtysh_client[i].name);
+ ret = vtysh_client_execute (&vtysh_client[i], line, stdout);
+ fprintf (stdout,"\n");
+ }
+
return ret;
}