Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 06:46:14 +0000 (UTC)
From:      John Hay <jhay@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194684 - head/sbin/sysctl
Message-ID:  <200906230646.n5N6kEQS066668@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906230646.n5N6kEQS066668>