From 50ef79ad104a8bd26fb21504c13f7e4866824098 Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Sat, 27 Jun 2020 12:41:21 +0100
Subject: Build: separate guard for futimens()

Darwin does not have the data element we manipulate with futimens()
---
 src/OS/os.h-FreeBSD | 1 +
 src/OS/os.h-Linux   | 1 +
 src/OS/os.h-OpenBSD | 1 +
 src/OS/os.h-SunOS5  | 1 +
 src/src/exim_lock.c | 2 +-
 5 files changed, 5 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/OS/os.h-FreeBSD b/src/OS/os.h-FreeBSD
index 548a82d4b..c1720a796 100644
--- a/src/OS/os.h-FreeBSD
+++ b/src/OS/os.h-FreeBSD
@@ -15,6 +15,7 @@
 #define HAVE_SRANDOMDEV
 #define HAVE_ARC4RANDOM
 #define EXIM_HAVE_OPENAT
+#define EXIM_HAVE_FUTIMENS
 
 /* Applications should not call arc4random_stir() explicitly after
  * FreeBSD r227520 (approximately 1000002).
diff --git a/src/OS/os.h-Linux b/src/OS/os.h-Linux
index ba5f13450..4a141346d 100644
--- a/src/OS/os.h-Linux
+++ b/src/OS/os.h-Linux
@@ -73,6 +73,7 @@ then change the 0 to 1 in the next block. */
 
 #if _POSIX_C_SOURCE >= 200809L || _ATFILE_SOURCE
 # define EXIM_HAVE_OPENAT
+# define EXIM_HAVE_FUTIMENS
 #endif
 
 /* TCP Fast Open support */
diff --git a/src/OS/os.h-OpenBSD b/src/OS/os.h-OpenBSD
index dc5dc0233..f599c09e4 100644
--- a/src/OS/os.h-OpenBSD
+++ b/src/OS/os.h-OpenBSD
@@ -8,6 +8,7 @@
 #define HAVE_SYS_MOUNT_H
 #define SIOCGIFCONF_GIVES_ADDR
 #define EXIM_HAVE_OPENAT
+#define EXIM_HAVE_FUTIMENS
 #define HAVE_ARC4RANDOM
 /* In May 2014, OpenBSD 5.5 was released which cleaned up the arc4random_* API
    which removed the arc4random_stir() function. Set NOT_HAVE_ARC4RANDOM_STIR
diff --git a/src/OS/os.h-SunOS5 b/src/OS/os.h-SunOS5
index 6331f3701..f5bc31668 100644
--- a/src/OS/os.h-SunOS5
+++ b/src/OS/os.h-SunOS5
@@ -9,6 +9,7 @@
 #define HAVE_GETIPNODEBYNAME    1
 #define HAVE_GETIPNODEBYADDR    1
 #define EXIM_HAVE_OPENAT
+#define EXIM_HAVE_FUTIMENS
 
 #define HAVE_KSTAT
 #define LOAD_AVG_KSTAT         "system_misc"
diff --git a/src/src/exim_lock.c b/src/src/exim_lock.c
index 068216816..2624aff5e 100644
--- a/src/src/exim_lock.c
+++ b/src/src/exim_lock.c
@@ -584,7 +584,7 @@ else
 if (restore_times)
   {
   struct stat strestore;
-#ifdef EXIM_HAVE_OPENAT
+#ifdef EXIM_HAVE_FUTIMENS
   int fd = open(filename, O_RDWR); /* use fd for both get & restore */
   struct timespec tt[2];
 
-- 
cgit v1.2.3