summaryrefslogtreecommitdiff
path: root/usr.sbin/rtsold/dump.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-31 09:53:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-31 09:53:27 +0000
commit4d373c4a676771041c805b6a2583e193324e6f8d (patch)
tree3381837b3bf7335be9cec1c272641d207331a65b /usr.sbin/rtsold/dump.c
parent23c764dea356800d33d5ee45822da12470a0d6d1 (diff)
KNF; itojun ok
Diffstat (limited to 'usr.sbin/rtsold/dump.c')
-rw-r--r--usr.sbin/rtsold/dump.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/usr.sbin/rtsold/dump.c b/usr.sbin/rtsold/dump.c
index 57d614e8219..deaa6b356f8 100644
--- a/usr.sbin/rtsold/dump.c
+++ b/usr.sbin/rtsold/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.7 2002/02/16 21:28:09 millert Exp $ */
+/* $OpenBSD: dump.c,v 1.8 2002/05/31 09:53:26 deraadt Exp $ */
/* $KAME: dump.c,v 1.9 2001/08/20 06:55:54 itojun Exp $ */
/*
@@ -68,27 +68,26 @@ dump_interface_status()
if (ifinfo->probeinterval) {
fprintf(fp, "%d\n", ifinfo->probeinterval);
fprintf(fp, " probe timer: %d\n", ifinfo->probetimer);
- }
- else {
+ } else {
fprintf(fp, "infinity\n");
fprintf(fp, " no probe timer\n");
}
fprintf(fp, " interface status: %s\n",
- ifinfo->active > 0 ? "active" : "inactive");
+ ifinfo->active > 0 ? "active" : "inactive");
fprintf(fp, " rtsold status: %s\n", ifstatstr[ifinfo->state]);
fprintf(fp, " carrier detection: %s\n",
- ifinfo->mediareqok ? "available" : "unavailable");
+ ifinfo->mediareqok ? "available" : "unavailable");
fprintf(fp, " probes: %d, dadcount = %d\n",
- ifinfo->probes, ifinfo->dadcount);
+ ifinfo->probes, ifinfo->dadcount);
if (ifinfo->timer.tv_sec == tm_max.tv_sec &&
ifinfo->timer.tv_usec == tm_max.tv_usec)
fprintf(fp, " no timer\n");
else {
fprintf(fp, " timer: interval=%d:%d, expire=%s\n",
- (int)ifinfo->timer.tv_sec,
- (int)ifinfo->timer.tv_usec,
- (ifinfo->expire.tv_sec < now.tv_sec) ? "expired"
- : sec2str(ifinfo->expire.tv_sec - now.tv_sec));
+ (int)ifinfo->timer.tv_sec,
+ (int)ifinfo->timer.tv_usec,
+ (ifinfo->expire.tv_sec < now.tv_sec) ? "expired"
+ : sec2str(ifinfo->expire.tv_sec - now.tv_sec));
}
fprintf(fp, " number of valid RAs: %d\n", ifinfo->racnt);
}
@@ -100,12 +99,10 @@ rtsold_dump_file(dumpfile)
{
if ((fp = fopen(dumpfile, "w")) == NULL) {
warnmsg(LOG_WARNING, __FUNCTION__, "open a dump file(%s): %s",
- dumpfile, strerror(errno));
+ dumpfile, strerror(errno));
return;
}
-
dump_interface_status();
-
fclose(fp);
}
@@ -147,6 +144,5 @@ sec2str(total)
p += n;
}
snprintf(p, ep - p, "%ds", secs);
-
return(result);
}