0002-utils-nfs-stat.c-include-time.h.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 034205b6b3acd64f9c75010d8da27e2c9f1bc82f Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 21 Jul 2024 18:04:05 +0200
  4. Subject: [PATCH] utils/nfs-stat.c: include time.h
  5. Include time.h to fix the following build failure with gcc >= 14 which
  6. enables -Werror=implicit-function-declaration
  7. (https://gcc.gnu.org/gcc-14/porting_to.html):
  8. nfs-stat.c: In function 'main':
  9. nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
  10. 287 | printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
  11. | ^~~~~
  12. nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
  13. 176 | #include <pwd.h>
  14. +++ |+#include <time.h>
  15. 177 | char *uid_to_name(int uid)
  16. Fixes:
  17. - http://autobuild.buildroot.org/results/73c3828a4e5d275ca0dfdd5b314494e2b00393c8
  18. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  19. Upstream: https://github.com/sahlberg/libnfs/commit/39e1ae0206fb519c551b48b0e6de57f3e764e886
  20. ---
  21. utils/nfs-stat.c | 1 +
  22. 1 file changed, 1 insertion(+)
  23. diff --git a/utils/nfs-stat.c b/utils/nfs-stat.c
  24. index 17ddb311..0ec33544 100644
  25. --- a/utils/nfs-stat.c
  26. +++ b/utils/nfs-stat.c
  27. @@ -50,6 +50,7 @@ WSADATA wsaData;
  28. #include <inttypes.h>
  29. #include <sys/types.h>
  30. #include <fcntl.h>
  31. +#include <time.h>
  32. #include "libnfs.h"
  33. #include "libnfs-raw.h"
  34. #include "libnfs-raw-mount.h"