summaryrefslogtreecommitdiffstats
path: root/contrib/pf/pfctl/pfctl_qstats.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pf/pfctl/pfctl_qstats.c')
-rw-r--r--contrib/pf/pfctl/pfctl_qstats.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/pf/pfctl/pfctl_qstats.c b/contrib/pf/pfctl/pfctl_qstats.c
index 19ca600..1731ce9 100644
--- a/contrib/pf/pfctl/pfctl_qstats.c
+++ b/contrib/pf/pfctl/pfctl_qstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl_qstats.c,v 1.29 2004/03/15 15:25:44 dhartmei Exp $ */
+/* $OpenBSD: pfctl_qstats.c,v 1.30 2004/04/27 21:47:32 kjc Exp $ */
/*
* Copyright (c) Henning Brauer <henning@openbsd.org>
@@ -90,6 +90,8 @@ pfctl_show_altq(int dev, const char *iface, int opts, int verbose2)
if ((nodes = pfctl_update_qstats(dev, &root)) < 0)
return (-1);
+ if (nodes == 0)
+ printf("No queue in use\n");
for (node = root; node != NULL; node = node->next) {
if (iface != NULL && strcmp(node->altq.ifname, iface))
continue;
@@ -100,11 +102,11 @@ pfctl_show_altq(int dev, const char *iface, int opts, int verbose2)
pfctl_print_altq_node(dev, node, 0, opts);
}
- while (verbose2) {
+ while (verbose2 && nodes > 0) {
printf("\n");
fflush(stdout);
sleep(STAT_INTERVAL);
- if (pfctl_update_qstats(dev, &root) == -1)
+ if ((nodes = pfctl_update_qstats(dev, &root)) == -1)
return (-1);
for (node = root; node != NULL; node = node->next) {
if (iface != NULL && strcmp(node->altq.ifname, iface))
OpenPOWER on IntegriCloud