Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Dec 2009 17:41:57 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r200781 - head/usr.bin/truss
Message-ID:  <200912211741.nBLHfvxW034937@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Mon Dec 21 17:41:57 2009
New Revision: 200781
URL: http://svn.freebsd.org/changeset/base/200781

Log:
  Cast time_t values to intmax_t and use %jd with printf.
  
  OK'ed by:	delphij
  Approved by:	trasz (mentor)

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Mon Dec 21 17:38:13 2009	(r200780)
+++ head/usr.bin/truss/syscalls.c	Mon Dec 21 17:41:57 2009	(r200781)
@@ -1161,15 +1161,15 @@ print_summary(struct trussinfo *trussinf
 	ncall = nerror = 0;
 	for (sc = syscalls; sc->name != NULL; sc++)
 		if (sc->ncalls) {
-			fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n",
-			    sc->name, sc->time.tv_sec, sc->time.tv_nsec,
-			    sc->ncalls, sc->nerror);
+			fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n",
+			    sc->name, (intmax_t)sc->time.tv_sec,
+			    sc->time.tv_nsec, sc->ncalls, sc->nerror);
 			timespecadd(&total, &sc->time, &total);
 			ncall += sc->ncalls;
 			nerror += sc->nerror;
 		}
 	fprintf(trussinfo->outfile, "%20s%15s%8s%8s\n",
 		"", "-------------", "-------", "-------");
-	fprintf(trussinfo->outfile, "%-20s%5d.%09ld%8d%8d\n",
-		"", total.tv_sec, total.tv_nsec, ncall, nerror);
+	fprintf(trussinfo->outfile, "%-20s%5jd.%09ld%8d%8d\n",
+		"", (intmax_t)total.tv_sec, total.tv_nsec, ncall, nerror);
 }



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