aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/timed
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-12-19 20:29:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-12-19 20:29:50 +0000
commit655353a78ceb330b89bf84d8ef38bada92fe022b (patch)
treed7fe90d2ca4c3332900e2e185a2189c4bdcab062 /usr.sbin/timed
parent167057914b42f2ab587d9e215158d07efb1a9cf4 (diff)
downloadsrc-655353a78ceb330b89bf84d8ef38bada92fe022b.tar.gz
src-655353a78ceb330b89bf84d8ef38bada92fe022b.zip
Some people pointed out long is 32-bit on some arches, while time_t is
64-bit, so better cast time_t to intmax_t, and use the appropriate printf format strings. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=228719
Diffstat (limited to 'usr.sbin/timed')
-rw-r--r--usr.sbin/timed/timed/correct.c4
-rw-r--r--usr.sbin/timed/timed/readmsg.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/timed/timed/correct.c b/usr.sbin/timed/timed/correct.c
index 2334e75ed1b4..0eab083c2ef9 100644
--- a/usr.sbin/timed/timed/correct.c
+++ b/usr.sbin/timed/timed/correct.c
@@ -162,8 +162,8 @@ adjclock(corr)
}
} else {
syslog(LOG_WARNING,
- "clock correction %ld sec too large to adjust",
- (long)adj.tv_sec);
+ "clock correction %jd sec too large to adjust",
+ (intmax_t)adj.tv_sec);
(void) gettimeofday(&now, 0);
timevaladd(&now, corr);
if (settimeofday(&now, 0) < 0)
diff --git a/usr.sbin/timed/timed/readmsg.c b/usr.sbin/timed/timed/readmsg.c
index 68a5fadfad93..9bbb3d784d51 100644
--- a/usr.sbin/timed/timed/readmsg.c
+++ b/usr.sbin/timed/timed/readmsg.c
@@ -181,8 +181,8 @@ again:
rwait.tv_usec = 1000000/CLK_TCK;
if (trace) {
- fprintf(fd, "readmsg: wait %ld.%6ld at %s\n",
- (long)rwait.tv_sec, rwait.tv_usec, date());
+ fprintf(fd, "readmsg: wait %jd.%6ld at %s\n",
+ (intmax_t)rwait.tv_sec, rwait.tv_usec, date());
/* Notice a full disk, as we flush trace info.
* It is better to flush periodically than at
* every line because the tracing consists of bursts