svn commit: r194684 - head/sbin/sysctl

John Hay jhay at FreeBSD.org
Tue Jun 23 06:46:16 UTC 2009


Author: jhay
Date: Tue Jun 23 06:46:14 2009
New Revision: 194684
URL: http://svn.freebsd.org/changeset/base/194684

Log:
  time_t does not always fit into long, for instance on arm. So rather cast
  it intmax_t and use %j in printf.

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==============================================================================
--- head/sbin/sysctl/sysctl.c	Tue Jun 23 06:11:04 2009	(r194683)
+++ head/sbin/sysctl/sysctl.c	Tue Jun 23 06:46:14 2009	(r194684)
@@ -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++)


More information about the svn-src-head mailing list