From 9dd67783bb2bd9ef8a972a1aac47b1925069a655 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Wed, 13 Aug 2014 02:32:06 -0400 Subject: [PATCH] viced: time_t might not be long Fix a couple of printf format errors that bite on FreeBSD 10 for i386. Since time_t might be an int, it can't be printed with a long format. Since time_t might be a long in general, cast to it to long when printing. Change-Id: Iecc4487adee7a64542dd2dc17f94485a6198e707 Reviewed-on: http://gerrit.openafs.org/11385 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Jeffrey Altman --- src/viced/callback.c | 3 ++- src/viced/fsprobe.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/viced/callback.c b/src/viced/callback.c index 9d22156..3c2e35a 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -2970,7 +2970,8 @@ PrintCB(struct CallBack *cb, afs_uint32 now) printf("vol=%" AFS_VOLID_FMT " vn=%u cbs=%d hi=%d st=%d fest=%d, exp in %lu secs at %s", afs_printable_VolumeId_lu(fe->volid), fe->vnode, fe->ncbs, - cb->hhead, cb->status, fe->status, expires - now, ctime(&expires)); + cb->hhead, cb->status, fe->status, (unsigned long)(expires - now), + ctime(&expires)); } #endif diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index b236023..a727274 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -90,8 +90,8 @@ main(int argc, char **argv) code = RXAFS_GetTime(cstruct->conns[0], (afs_uint32 *)&tv.tv_sec, (afs_uint32 *)&tv.tv_usec); if (!code) - printf("AFS_GetTime on %s sec=%ld, usec=%ld\n", av[0], tv.tv_sec, - (long int)tv.tv_usec); + printf("AFS_GetTime on %s sec=%ld, usec=%ld\n", av[0], (long)tv.tv_sec, + (long)tv.tv_usec); else printf("return code is %d\n", code); -- 1.9.4