summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornorby <norby@openbsd.org>2007-10-11 12:03:37 +0000
committernorby <norby@openbsd.org>2007-10-11 12:03:37 +0000
commit11c16ffab74beeebbf1e02f1f94372d993d2de41 (patch)
tree91ae457b8b2e742ba603f2de81a3373d904895cb
parentsched_lock_idle and sched_unlock_idle are obsolete now. (diff)
downloadwireguard-openbsd-11c16ffab74beeebbf1e02f1f94372d993d2de41.tar.xz
wireguard-openbsd-11c16ffab74beeebbf1e02f1f94372d993d2de41.zip
Cleanup the way we display timers.
It does not make sense to display timer = 0 as "Stopped". When a timer is 0 it usually means that it is getting reset very soon. Display the string "00:00:00" instead. ok claudio@
-rw-r--r--usr.sbin/ospfctl/ospfctl.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.sbin/ospfctl/ospfctl.c b/usr.sbin/ospfctl/ospfctl.c
index 04ad2b4fbe4..73e761e3026 100644
--- a/usr.sbin/ospfctl/ospfctl.c
+++ b/usr.sbin/ospfctl/ospfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfctl.c,v 1.38 2007/09/11 16:01:22 claudio Exp $ */
+/* $OpenBSD: ospfctl.c,v 1.39 2007/10/11 12:03:37 norby Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -295,8 +295,7 @@ show_summary_msg(struct imsg *imsg)
case IMSG_CTL_SHOW_SUM:
sum = imsg->data;
printf("Router ID: %s\n", inet_ntoa(sum->rtr_id));
- printf("Uptime: %s\n", sum->uptime == 0 ? "00:00:00" :
- fmt_timeframe_core(sum->uptime));
+ printf("Uptime: %s\n", fmt_timeframe_core(sum->uptime));
printf("RFC1583 compatibility flag is ");
if (sum->rfc1583compat)
printf("enabled\n");
@@ -362,12 +361,10 @@ show_interface_msg(struct imsg *imsg)
err(1, NULL);
printf("%-11s %-18s %-6s %-10s %-10s %s %3d %3d\n",
iface->name, netid, if_state_name(iface->state),
- iface->hello_timer < 0 ? "stopped" :
fmt_timeframe_core(iface->hello_timer),
get_linkstate(get_ifms_type(iface->mediatype),
- iface->linkstate), iface->uptime == 0 ? "00:00:00" :
- fmt_timeframe_core(iface->uptime), iface->nbr_cnt,
- iface->adj_cnt);
+ iface->linkstate), fmt_timeframe_core(iface->uptime),
+ iface->nbr_cnt, iface->adj_cnt);
free(netid);
break;
case IMSG_CTL_END:
@@ -421,8 +418,7 @@ show_interface_detail_msg(struct imsg *imsg)
else
printf(" Hello timer due in %s\n",
fmt_timeframe_core(iface->hello_timer));
- printf(" Uptime %s\n", iface->uptime == 0 ?
- "00:00:00" : fmt_timeframe_core(iface->uptime));
+ printf(" Uptime %s\n", fmt_timeframe_core(iface->uptime));
printf(" Neighbor count is %d, adjacent neighbor count is "
"%d\n", iface->nbr_cnt, iface->adj_cnt);
if (iface->auth_type > 0) {
@@ -482,7 +478,7 @@ fmt_timeframe_core(time_t t)
unsigned sec, min, hrs, day, week;
if (t == 0)
- return ("Stopped");
+ return ("00:00:00");
buf = tfbuf[idx++];
if (idx == TF_BUFS)