Commit 51b0d5d5 authored by Ondřej Surý's avatar Ondřej Surý

Replace platform ISC_PLATFORM_HAVESTATNSEC with config ENABLE_STAT_NSEC

parent f1d3055d
......@@ -398,6 +398,9 @@
/* Define to 1 if you have the `sigwait' function. */
#undef HAVE_SIGWAIT
/* define if struct stat has st_mtim.tv_nsec field */
#undef HAVE_STAT_NSEC
/* Define to 1 if you have the <stdatomic.h> header file. */
#undef HAVE_STDATOMIC_H
......
......@@ -708,7 +708,6 @@ FSTRM_CAPTURE
PROTOC_C
IRS_PLATFORM_USEDECLSPEC
ISC_PLATFORM_USEDECLSPEC
ISC_PLATFORM_HAVESTATNSEC
ISC_PLATFORM_HAVESYSUNH
LIBCAP_LIBS
DST_EXTRA_SRCS
......@@ -17918,31 +17917,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# Check for nanoseconds in file stats
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking st_mtim.tv_nsec" >&5
$as_echo_n "checking st_mtim.tv_nsec... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_mtim.tv_nsec" >&5
$as_echo_n "checking for st_mtim.tv_nsec... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/fcntl.h>
int
main ()
{
struct stat s; return(s.st_mtim.tv_nsec);
struct stat s;
return(s.st_mtim.tv_nsec);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"
$as_echo "#define HAVE_STAT_NSEC 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# Microsoft has their own way of handling shared libraries that requires
# additional qualifiers on extern variables. Unix systems don't need it.
......
......@@ -1990,13 +1990,14 @@ AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
#
# Check for nanoseconds in file stats
#
AC_MSG_CHECKING(st_mtim.tv_nsec)
AC_TRY_COMPILE([#include <sys/fcntl.h>],[struct stat s; return(s.st_mtim.tv_nsec);],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"])
AC_SUBST(ISC_PLATFORM_HAVESTATNSEC)
AC_MSG_CHECKING([for st_mtim.tv_nsec])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/fcntl.h>]],
[[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])])
#
# Microsoft has their own way of handling shared libraries that requires
......
......@@ -58,11 +58,6 @@
*/
@ISC_PLATFORM_KRB5HEADER@
/*
* Define if the system has nanosecond-level accuracy in file stats.
*/
@ISC_PLATFORM_HAVESTATNSEC@
/*
* Used to control how extern data is linked; needed for Win32 platforms.
*/
......
......@@ -146,7 +146,7 @@ isc_file_getmodtime(const char *file, isc_time_t *modtime) {
result = file_stats(file, &stats);
if (result == ISC_R_SUCCESS)
#ifdef ISC_PLATFORM_HAVESTATNSEC
#if defined(HAVE_STAT_NSEC)
isc_time_set(modtime, stats.st_mtime, stats.st_mtim.tv_nsec);
#else
isc_time_set(modtime, stats.st_mtime, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment