Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jul 2013 16:56:31 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253744 - head/usr.sbin/watchdogd
Message-ID:  <201307281656.r6SGuVYx023459@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Jul 28 16:56:31 2013
New Revision: 253744
URL: http://svnweb.freebsd.org/changeset/base/253744

Log:
  Fix printf of seconds for systems where time_t is 64 bits.

Modified:
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/usr.sbin/watchdogd/watchdogd.c
==============================================================================
--- head/usr.sbin/watchdogd/watchdogd.c	Sun Jul 28 16:50:45 2013	(r253743)
+++ head/usr.sbin/watchdogd/watchdogd.c	Sun Jul 28 16:56:31 2013	(r253744)
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
 #include <paths.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
@@ -230,10 +231,10 @@ parse_timeout_to_pow2ns(char opt, const 
 	if (debugging) {
 		printf("Timeout for %s%s "
 		    "is 2^%d nanoseconds "
-		    "(in: %s sec -> out: %ld sec %ld ns -> %d ticks)\n",
+		    "(in: %s sec -> out: %jd sec %ld ns -> %d ticks)\n",
 		    longopt ? "-" : "", longopt ? longopt : shortopt,
 		    rv,
-		    myoptarg, ts.tv_sec, ts.tv_nsec, ticks);
+		    myoptarg, (intmax_t)ts.tv_sec, ts.tv_nsec, ticks);
 	}
 	if (ticks <= 0) {
 		errx(1, "Timeout for %s%s is too small, please choose a higher timeout.", longopt ? "-" : "", longopt ? longopt : shortopt);



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