diff mbox series

[nfs-utils,2/2] nfsdcltrack/nfsdcltrack.c: Fix printf format

Message ID 20210722161545.26923-2-petr.vorel@gmail.com (mailing list archive)
State New, archived
Headers show
Series [nfs-utils,1/2] nfsdcltrack/sqlite: Fix printf format | expand

Commit Message

Petr Vorel July 22, 2021, 4:15 p.m. UTC
nfsdcltrack.c: In function 'cltrack_gracedone':
nfsdcltrack.c:528:47: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Werror=format=]
  528 |  xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
      |                                             ~~^             ~~~~~~~~~
      |                                               |             |
      |                                               long int      time_t {aka long long int}
      |                                             %lld

Found in Buildroot riscv32 build.

Link: http://autobuild.buildroot.net/results/9bc1d43a588338b7395af7bc97535ee16a6ea2d9/build-end.log

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 utils/nfsdcltrack/nfsdcltrack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index e926f1c0..0b37c094 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -33,6 +33,7 @@ 
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include <libgen.h>
 #include <sys/inotify.h>
@@ -525,7 +526,7 @@  cltrack_gracedone(const char *timestr)
 	if (*tail)
 		return -EINVAL;
 
-	xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
+	xlog(D_GENERAL, "%s: grace done. gracetime=%"PRIu64, __func__, gracetime);
 
 	ret = sqlite_remove_unreclaimed(gracetime);