aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-09-07 08:02:25 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-09-07 08:08:29 +0300
commit32517af75ac8c32b3ff4870e14ff28418696c554 (patch)
treeafa94e0713b8dc70c9e17036e07be02caaff8ddd /configure.ac
parent4d5be2bb19bd299a5bd3525c4e28f571929d70de (diff)
downloadgdbm-32517af75ac8c32b3ff4870e14ff28418696c554.tar.gz
gdbm-32517af75ac8c32b3ff4870e14ff28418696c554.tar.bz2
Determine if st_mtim is present in struct stat
* configure.ac: Check for st_mtim and st_mtimespec in struct stat. The former is POSIX, the latter is used instead of it on some systems (reportedly, Darwin and NetBSD). * src/systems.h [!HAVE_STRUCT_STAT_ST_MTIM]: Use st_mtimespec if available. * src/gdbmshell.c (print_snapshot): Fall back to st_mtime if nanosecond precision is not available. * src/gdbmsync.c (timespec_cmp): Take two pointers to struct stat as arguments. Use the right time field, depending on the configuration settings. All uses changed.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 4e5b62d..2c22ace 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,7 +108,9 @@ then
fi
AC_TYPE_OFF_T
AC_CHECK_SIZEOF(off_t)
-AC_CHECK_MEMBERS([struct stat.st_blksize])
+AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_mtim, struct stat.st_mtimespec],[],[],
+ [#include <sys/types.h>
+ #include <sys/stat.h>])
AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])

Return to:

Send suggestions and report system problems to the System administrator.