From e052e4211b0db67fe013e6572c411c6a38a1f260 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 24 Jan 2020 04:46:15 +0000 Subject: user/nfs-utils: Fix build on 32-bit architectures --- user/nfs-utils/time64.patch | 123 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 user/nfs-utils/time64.patch (limited to 'user/nfs-utils/time64.patch') diff --git a/user/nfs-utils/time64.patch b/user/nfs-utils/time64.patch new file mode 100644 index 000000000..024402554 --- /dev/null +++ b/user/nfs-utils/time64.patch @@ -0,0 +1,123 @@ +--- nfs-utils-2.4.2/support/nfs/cacheio.c.old 2019-11-13 17:09:41.000000000 +0000 ++++ nfs-utils-2.4.2/support/nfs/cacheio.c 2020-01-24 03:32:30.296395221 +0000 +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + extern struct state_paths etab; + +@@ -234,7 +235,7 @@ + stb.st_mtime > now) + stb.st_mtime = time(0); + +- sprintf(stime, "%ld\n", stb.st_mtime); ++ sprintf(stime, "%"PRId64"\n", stb.st_mtime); + for (c=0; cachelist[c]; c++) { + int fd; + sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); +--- nfs-utils-2.4.2/utils/idmapd/idmapd.c.old 2019-11-13 17:09:41.000000000 +0000 ++++ nfs-utils-2.4.2/utils/idmapd/idmapd.c 2020-01-24 03:35:05.459393437 +0000 +@@ -65,6 +65,7 @@ + #include + #include + #include ++#include + + #include "xlog.h" + #include "conffile.h" +@@ -172,7 +173,7 @@ + int fd; + char stime[32]; + +- sprintf(stime, "%ld\n", now); ++ sprintf(stime, "%"PRId64"\n", now); + fd = open(path, O_RDWR); + if (fd == -1) + return -1; +@@ -625,7 +626,7 @@ + /* Name */ + addfield(&bp, &bsiz, im.im_name); + /* expiry */ +- snprintf(buf1, sizeof(buf1), "%lu", ++ snprintf(buf1, sizeof(buf1), "%"PRIu64, + time(NULL) + cache_entry_expiration); + addfield(&bp, &bsiz, buf1); + /* Note that we don't want to write the id if the mapping +@@ -653,7 +654,7 @@ + snprintf(buf1, sizeof(buf1), "%u", im.im_id); + addfield(&bp, &bsiz, buf1); + /* expiry */ +- snprintf(buf1, sizeof(buf1), "%lu", ++ snprintf(buf1, sizeof(buf1), "%"PRIu64, + time(NULL) + cache_entry_expiration); + addfield(&bp, &bsiz, buf1); + /* Note we're ignoring the status field in this case; we'll +--- nfs-utils-2.4.2/utils/nfsdcld/sqlite.c.old 2019-11-13 17:09:41.000000000 +0000 ++++ nfs-utils-2.4.2/utils/nfsdcld/sqlite.c 2020-01-24 04:35:02.235281405 +0000 +@@ -512,7 +512,7 @@ + current_epoch = tcur; + recovery_epoch = trec; + ret = 0; +- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu", ++ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64, + __func__, current_epoch, recovery_epoch); + out: + sqlite3_finalize(stmt); +@@ -1223,7 +1223,7 @@ + + current_epoch = tcur; + recovery_epoch = trec; +- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu", ++ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64, + __func__, current_epoch, recovery_epoch); + + out: +@@ -1282,7 +1282,7 @@ + } + + recovery_epoch = 0; +- xlog(D_GENERAL, "%s: current_epoch=%lu recovery_epoch=%lu", ++ xlog(D_GENERAL, "%s: current_epoch=%"PRIu64" recovery_epoch=%"PRIu64, + __func__, current_epoch, recovery_epoch); + + out: +--- nfs-utils-2.4.2/utils/nfsdcltrack/nfsdcltrack.c.old 2019-11-13 17:09:41.000000000 +0000 ++++ nfs-utils-2.4.2/utils/nfsdcltrack/nfsdcltrack.c 2020-01-24 04:40:06.871901242 +0000 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #ifdef HAVE_SYS_CAPABILITY_H + #include + #include +@@ -525,7 +526,7 @@ + if (*tail) + return -EINVAL; + +- xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime); ++ xlog(D_GENERAL, "%s: grace done. gracetime=%"PRId64, __func__, gracetime); + + ret = sqlite_remove_unreclaimed(gracetime); + +--- nfs-utils-2.4.2/utils/nfsdcltrack/sqlite.c.old 2019-11-13 17:09:41.000000000 +0000 ++++ nfs-utils-2.4.2/utils/nfsdcltrack/sqlite.c 2020-01-24 04:40:31.519202517 +0000 +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + #include + + #include "xlog.h" +@@ -544,7 +545,7 @@ + int ret; + char *err = NULL; + +- ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld", ++ ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %"PRId64, + grace_start); + if (ret < 0) { + return ret; -- cgit v1.2.3-60-g2f50