diff mbox series

cacheio: use intmax_t for formatted IO

Message ID 20181201181621.7268-1-raj.khem@gmail.com (mailing list archive)
State New, archived
Headers show
Series cacheio: use intmax_t for formatted IO | expand

Commit Message

Khem Raj Dec. 1, 2018, 6:16 p.m. UTC
time_t is not same size on x32 ABI (ILP32)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 support/nfs/cacheio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
index 9dc4cf1..2086a95 100644
--- a/support/nfs/cacheio.c
+++ b/support/nfs/cacheio.c
@@ -17,6 +17,7 @@ 
 
 #include <nfslib.h>
 #include <stdio.h>
+#include <inttypes.h>
 #include <stdio_ext.h>
 #include <string.h>
 #include <ctype.h>
@@ -234,7 +235,7 @@  cache_flush(int force)
 	    stb.st_mtime > now)
 		stb.st_mtime = time(0);
 	
-	sprintf(stime, "%ld\n", stb.st_mtime);
+	sprintf(stime, "%jd\n", (intmax_t)stb.st_mtime);
 	for (c=0; cachelist[c]; c++) {
 		int fd;
 		sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]);