SPDX: license tags (mostly by guesswork)
[exim.git] / src / src / transports / queuefile.c
index bb2b9b9f325fca9ecff9492672c4ba9c864c728e..3a2bae22faf2ab8adfe3a7b2df683e347dfa20a8 100644 (file)
@@ -4,13 +4,21 @@
 
 /* Copyright (c) Andrew Colin Kissa <andrew@topdog.za.net> 2016 */
 /* Copyright (c) University of Cambridge 2016 */
-/* Copyright (c) The Exim Maintainers 1995 - 2018 */
+/* Copyright (c) The Exim Maintainers 1995 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-only */
+
 
 
 #include "../exim.h"
+
+#ifdef EXPERIMENTAL_QUEUEFILE  /* whole file */
 #include "queuefile.h"
 
+#ifndef EXIM_HAVE_OPENAT
+# error queuefile transport reqires openat() support
+#endif
+
 /* Options specific to the appendfile transport. They must be in alphabetic
 order (note that "_" comes before the lower case letters). Some of them are
 stored in the publicly visible instance block - these are flagged with the
@@ -18,7 +26,7 @@ opt_public flag. */
 
 optionlist queuefile_transport_options[] = {
   { "directory", opt_stringptr,
-    (void *)offsetof(queuefile_transport_options_block, dirname) },
+    OPT_OFF(queuefile_transport_options_block, dirname) },
 };
 
 
@@ -134,11 +142,11 @@ else                                      /* use data copy */
     tb->name, srcpath, dstpath);
 
   if (  (s = dstpath,
-        (dstfd = openat(ddfd, CCS filename, O_RDWR|O_CREAT|O_EXCL, SPOOL_MODE))
+        (dstfd = exim_openat4(ddfd, CCS filename, O_RDWR|O_CREAT|O_EXCL, SPOOL_MODE))
         < 0
        )
      ||    is_hdr_file
-       && (s = srcpath, (srcfd = openat(sdfd, CCS filename, O_RDONLY)) < 0)
+       && (s = srcpath, (srcfd = exim_openat(sdfd, CCS filename, O_RDONLY)) < 0)
      )
     op = US"opening";
 
@@ -276,3 +284,4 @@ return FALSE;
 }
 
 #endif /*!MACRO_PREDEF*/
+#endif /*EXPERIMENTAL_QUEUEFILE*/