summaryrefslogtreecommitdiff
path: root/nt
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-03-08 17:00:10 +0200
committerEli Zaretskii <eliz@gnu.org>2020-03-08 17:00:10 +0200
commit66bc47d12aba72ff738a9f5575e0b93eefc641ba (patch)
treec85ff0ed19d5067a45bd81e7251248a6ae8cf279 /nt
parent0a3f8da6e1a56ada409cf1677ac40fcc75a8a33c (diff)
downloademacs-66bc47d12aba72ff738a9f5575e0b93eefc641ba.tar.gz
Fix the MinGW build as followup to recent "nofollow" changes
* src/w32.c (fdutimens): Call utimensat instead of utime. (set_file_times): Function deleted. (convert_from_timespec): Renamed from convert_from_time_t and modified to accept 'struct timespec' argument instead of 'time_t'. (utimensat): Renamed from utime and modified to accept 'struct timespec [2]' argument and an additional argument FLAG. Emulate Posix 'utimensat'. Call 'convert_from_timespec'. (w32_copy_file): Call 'utimensat' instead of 'set_file_times'. * src/fileio.c (Fcopy_file) [WINDOWSNT]: Make the error message be identical to that on Posix platforms. * nt/inc/sys/stat.h (utimensat): Provide prototype. * nt/mingw-cfg.site (ac_cv_func_futimens) (gl_cv_func_futimens_works, ac_cv_func_utimensat) (gl_cv_func_utimensat_works): Override Gnulib tests. * nt/gnulib-cfg.mk (OMIT_GNULIB_MODULE_futimens) (OMIT_GNULIB_MODULE_utimensat): Disable these Gnulib modules.
Diffstat (limited to 'nt')
-rw-r--r--nt/gnulib-cfg.mk2
-rw-r--r--nt/inc/sys/stat.h5
-rw-r--r--nt/mingw-cfg.site4
3 files changed, 11 insertions, 0 deletions
diff --git a/nt/gnulib-cfg.mk b/nt/gnulib-cfg.mk
index 1d120a973d1..e3b945720d6 100644
--- a/nt/gnulib-cfg.mk
+++ b/nt/gnulib-cfg.mk
@@ -65,3 +65,5 @@ OMIT_GNULIB_MODULE_unistd = true
OMIT_GNULIB_MODULE_canonicalize-lgpl = true
OMIT_GNULIB_MODULE_fchmodat = true
OMIT_GNULIB_MODULE_lchmod = true
+OMIT_GNULIB_MODULE_futimens = true
+OMIT_GNULIB_MODULE_utimensat = true
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index 7bf780dbaa2..f58d5ab6573 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -164,4 +164,9 @@ int __cdecl __MINGW_NOTHROW fstatat (int, char const *,
struct stat *, int);
int __cdecl __MINGW_NOTHROW chmod (const char*, int);
+/* Provide prototypes of library functions that are emulated on w32
+ and whose prototypes are usually found in sys/stat.h on POSIX
+ platforms. */
+extern int utimensat (int, const char *, struct timespec const[2], int);
+
#endif /* INC_SYS_STAT_H_ */
diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site
index 5bd5b834634..2271eef98d6 100644
--- a/nt/mingw-cfg.site
+++ b/nt/mingw-cfg.site
@@ -105,6 +105,10 @@ gl_cv_func_fstatat_zero_flag=yes
ac_cv_func_fchmodat=yes
gl_cv_func_fchmodat_works="not-needed-so-yes"
ac_cv_func_lchmod=yes
+ac_cv_func_futimens=not-needed
+gl_cv_func_futimens_works="not-needed-so-yes"
+ac_cv_func_utimensat=yes
+gl_cv_func_utimensat_works=yes
# Aliased to _commit in ms-w32.h
ac_cv_func_fsync=yes
ac_cv_func_fdatasync=yes