]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
viced: time_t might not be long
authorGarrett Wollman <wollman@csail.mit.edu>
Wed, 13 Aug 2014 06:32:06 +0000 (02:32 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 9 Sep 2014 12:54:58 +0000 (08:54 -0400)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 9dd67783bb2bd9ef8a972a1aac47b1925069a655)

Change-Id: Icda432863a36169857a20300ab936a1a72de7891
Reviewed-on: http://gerrit.openafs.org/11404
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/viced/callback.c
src/viced/fsprobe.c

index 9daf5362a3bb4361356686919eec18663d60b00b..243789329c07101d51727688b3472034d010d733 100644 (file)
@@ -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
index e6b014cc920424cca57437b716d5b808dc0a956a..4437cbb76d4be69762fe02dca32a0abbd73d9715 100644 (file)
@@ -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);