Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
51b0d5d5
Commit
51b0d5d5
authored
Sep 05, 2018
by
Ondřej Surý
Browse files
Replace platform ISC_PLATFORM_HAVESTATNSEC with config ENABLE_STAT_NSEC
parent
f1d3055d
Changes
5
Hide whitespace changes
Inline
Side-by-side
config.h.in
View file @
51b0d5d5
...
...
@@ -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
...
...
configure
View file @
51b0d5d5
...
...
@@ -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.
...
...
configure.in
View file @
51b0d5d5
...
...
@@ -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
...
...
lib/isc/include/isc/platform.h.in
View file @
51b0d5d5
...
...
@@ -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.
*/
...
...
lib/isc/unix/file.c
View file @
51b0d5d5
...
...
@@ -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
def
ined(
HAVE
_
STAT
_
NSEC
)
isc_time_set
(
modtime
,
stats
.
st_mtime
,
stats
.
st_mtim
.
tv_nsec
);
#else
isc_time_set
(
modtime
,
stats
.
st_mtime
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment