From c177c33c2773d7efa4b5af5460fd354450529d05 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 20 Sep 2021 17:33:56 +1000 Subject: [PATCH] Use '#include ' for the stat structure definition POSIX.1-2008 changed the st_atim, st_mtim, and st_ctime members of the struct stat from time_t to struct timespec and because not all operating systems already implemented this version of the standard or historically deviated to include own nanosecond precision in the structure. The autoconf script used to include which contradicts POSIX.1 as it mandates inclusion. Change the autoconf check to include . Also fix the missing AC_MSG_RESULT([yes/no]) in the check. --- configure.ac | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 543ed9ba19..a582ad33a4 100644 --- a/configure.ac +++ b/configure.ac @@ -1058,11 +1058,13 @@ AC_COMPILE_IFELSE( AC_MSG_CHECKING([for st_mtim.tv_nsec]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[#include ]], + [[#include ]], [[struct stat s; return(s.st_mtim.tv_nsec); ]])], - [AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])]) + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_STAT_NSEC], [1], [define if struct stat has st_mtim.tv_nsec field])], + [AC_MSG_RESULT([no])]) # # Check for if_nametoindex() for IPv6 scoped addresses support