diff options
author | jhay <jhay@FreeBSD.org> | 2009-06-23 06:46:14 +0000 |
---|---|---|
committer | jhay <jhay@FreeBSD.org> | 2009-06-23 06:46:14 +0000 |
commit | 60286c36f07cfc94950f014eb460767718721305 (patch) | |
tree | 05945fab8e0ddf69717f049a7c9b913fa1838698 /sbin | |
parent | 6577661e696d4c0e8bd4cfa959ee56c2d13e0666 (diff) | |
download | FreeBSD-src-60286c36f07cfc94950f014eb460767718721305.zip FreeBSD-src-60286c36f07cfc94950f014eb460767718721305.tar.gz |
time_t does not always fit into long, for instance on arm. So rather cast
it intmax_t and use %j in printf.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/sysctl/sysctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index bcb5a11..4140fb3 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -365,9 +365,9 @@ S_timeval(int l2, void *p) warnx("S_timeval %d != %d", l2, sizeof(*tv)); return (1); } - printf(hflag ? "{ sec = %'ld, usec = %'ld } " : - "{ sec = %ld, usec = %ld } ", - tv->tv_sec, tv->tv_usec); + printf(hflag ? "{ sec = %'jd, usec = %'ld } " : + "{ sec = %jd, usec = %ld } ", + (intmax_t)tv->tv_sec, tv->tv_usec); tv_sec = tv->tv_sec; p1 = strdup(ctime(&tv_sec)); for (p2=p1; *p2 ; p2++) |