Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From ac32b813f5d6f9a2de944015cf9bb98d68e0203a Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 1 Dec 2018 10:02:12 -0800 |
| 4 | Subject: [PATCH] cacheio: use intmax_t for formatted IO |
| 5 | |
| 6 | time_t is not same size on x32 ABI (ILP32) |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | support/nfs/cacheio.c | 3 ++- |
| 13 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c |
| 16 | index 9dc4cf1..2086a95 100644 |
| 17 | --- a/support/nfs/cacheio.c |
| 18 | +++ b/support/nfs/cacheio.c |
| 19 | @@ -17,6 +17,7 @@ |
| 20 | |
| 21 | #include <nfslib.h> |
| 22 | #include <stdio.h> |
| 23 | +#include <inttypes.h> |
| 24 | #include <stdio_ext.h> |
| 25 | #include <string.h> |
| 26 | #include <ctype.h> |
| 27 | @@ -234,7 +235,7 @@ cache_flush(int force) |
| 28 | stb.st_mtime > now) |
| 29 | stb.st_mtime = time(0); |
| 30 | |
| 31 | - sprintf(stime, "%ld\n", stb.st_mtime); |
| 32 | + sprintf(stime, "%jd\n", (intmax_t)stb.st_mtime); |
| 33 | for (c=0; cachelist[c]; c++) { |
| 34 | int fd; |
| 35 | sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); |
| 36 | -- |
| 37 | 2.19.2 |
| 38 | |