0002-nfsdcltrack-nfsdcltrack.c-Fix-printf-format.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From 14eb2cae4fca95609ae4efde2444fd0a5ddfca04 Mon Sep 17 00:00:00 2001
  2. From: Petr Vorel <petr.vorel () gmail ! com>
  3. Date: Thu, 22 Jul 2021 16:15:45 +0000
  4. Subject: [PATCH] nfsdcltrack/nfsdcltrack.c: Fix printf format
  5. nfsdcltrack.c: In function 'cltrack_gracedone':
  6. 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=]
  7. 528 | xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
  8. | ~~^ ~~~~~~~~~
  9. | | |
  10. | long int time_t {aka long long int}
  11. | %lld
  12. Found in Buildroot riscv32 build.
  13. Link: http://autobuild.buildroot.net/results/9bc1d43a588338b7395af7bc97535ee16a6ea2d9/build-end.log
  14. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
  15. Upstream: http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=5a53426c0f4e84f6644c11e4f01015597d3bb82c
  16. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  17. ---
  18. utils/nfsdcltrack/nfsdcltrack.c | 3 ++-
  19. 1 file changed, 2 insertions(+), 1 deletion(-)
  20. diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
  21. index e926f1c0..0b37c094 100644
  22. --- a/utils/nfsdcltrack/nfsdcltrack.c
  23. +++ b/utils/nfsdcltrack/nfsdcltrack.c
  24. @@ -33,6 +33,7 @@
  25. #include <sys/stat.h>
  26. #include <sys/types.h>
  27. #include <fcntl.h>
  28. +#include <inttypes.h>
  29. #include <unistd.h>
  30. #include <libgen.h>
  31. #include <sys/inotify.h>
  32. @@ -525,7 +526,7 @@ cltrack_gracedone(const char *timestr)
  33. if (*tail)
  34. return -EINVAL;
  35. - xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
  36. + xlog(D_GENERAL, "%s: grace done. gracetime=%"PRIu64, __func__, gracetime);
  37. ret = sqlite_remove_unreclaimed(gracetime);
  38. --
  39. 2.25.1