summaryrefslogtreecommitdiff
path: root/usr.sbin/sysctl
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1995-06-07 17:40:51 +0000
committercgd <cgd@NetBSD.org>1995-06-07 17:40:51 +0000
commit29d4fed17fbd4f48c120ee83700e02eefea2b95b (patch)
treee00515cf03c8982844610e18be2e9461064d71a0 /usr.sbin/sysctl
parent10603feb5101fb1c049ac106f1e959b2fbe4bee8 (diff)
typeof(timeval.tv_sec) != time_t
Diffstat (limited to 'usr.sbin/sysctl')
-rw-r--r--usr.sbin/sysctl/sysctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index 2915be70499..bb409a8cdbd 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: sysctl.c,v 1.6 1995/06/02 15:03:34 pk Exp $";
+static char *rcsid = "$Id: sysctl.c,v 1.7 1995/06/07 17:41:17 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -377,11 +377,12 @@ parse(string, flags)
}
if (special & BOOTTIME) {
struct timeval *btp = (struct timeval *)buf;
+ time_t boottime;
- if (!nflag)
- fprintf(stdout, "%s = %s\n", string,
- ctime(&btp->tv_sec));
- else
+ if (!nflag) {
+ boottime = btp->tv_sec;
+ fprintf(stdout, "%s = %s\n", string, ctime(&boottime));
+ } else
fprintf(stdout, "%d\n", btp->tv_sec);
return;
}