From: Garrett Wollman Date: Wed, 13 Aug 2014 06:32:06 +0000 (-0400) Subject: viced: time_t might not be long X-Git-Tag: upstream/1.6.10^2~4 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=396679c7cf78d0e35171d0e101c4ec17b8d6c858;p=packages%2Fo%2Fopenafs.git 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. Reviewed-on: http://gerrit.openafs.org/11385 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Jeffrey Altman (cherry picked from commit 9dd67783bb2bd9ef8a972a1aac47b1925069a655) Change-Id: Icda432863a36169857a20300ab936a1a72de7891 Reviewed-on: http://gerrit.openafs.org/11404 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: D Brashear Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- diff --git a/src/viced/callback.c b/src/viced/callback.c index 9daf5362a..243789329 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -2961,7 +2961,7 @@ PrintCB(struct CallBack *cb, afs_uint32 now) printf("vol=%u vn=%u cbs=%d hi=%d st=%d fest=%d, exp in %lu secs at %s", fe->volid, fe->vnode, fe->ncbs, cb->hhead, cb->status, fe->status, - expires - now, ctime(&expires)); + (unsigned long)(expires - now), ctime(&expires)); } #endif diff --git a/src/viced/fsprobe.c b/src/viced/fsprobe.c index e6b014cc9..4437cbb76 100644 --- a/src/viced/fsprobe.c +++ b/src/viced/fsprobe.c @@ -94,8 +94,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);