/* Copyright (c) Andrew Colin Kissa <andrew@topdog.za.net> 2016 */
/* Copyright (c) University of Cambridge 2016 */
+/* Copyright (c) The Exim Maintainers 2017 */
/* See the file NOTICE for conditions of use and distribution. */
(void *)offsetof(queuefile_transport_options_block, dirname) },
};
+
/* Size of the options list. An extern variable has to be used so that its
address can appear in the tables drtables.c. */
int queuefile_transport_options_count =
sizeof(queuefile_transport_options) / sizeof(optionlist);
+
+#ifdef MACRO_PREDEF
+
+/* Dummy values */
+queuefile_transport_options_block queuefile_transport_option_defaults = {0};
+void queuefile_transport_init(transport_instance *tblock) {}
+BOOL queuefile_transport_entry(transport_instance *tblock, address_item *addr) {return FALSE;}
+
+#else /*!MACRO_PREDEF*/
+
+
+
/* Default private options block for the appendfile transport. */
queuefile_transport_options_block queuefile_transport_option_defaults = {
op = US"linking";
s = dstpath;
}
+else /* use data copy */
+ {
+ DEBUG(D_transport) debug_printf("%s transport, copying %s => %s\n",
+ tb->name, srcpath, dstpath);
-/* use data copy */
-
-DEBUG(D_transport) debug_printf("%s transport, copying %s => %s\n",
- tb->name, srcpath, dstpath);
+ if ( (s = dstpath,
+ (dstfd = openat(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)
+ )
+ op = US"opening";
-if ( (s = dstpath,
- (dstfd = openat(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)
- )
- op = US"opening";
-
-else
- if (s = dstpath, fchmod(dstfd, SPOOL_MODE) != 0)
- op = US"setting perms on";
else
- if (!copy_spool_file(dstfd, srcfd))
- op = US"creating";
+ if (s = dstpath, fchmod(dstfd, SPOOL_MODE) != 0)
+ op = US"setting perms on";
else
- return TRUE;
+ if (!copy_spool_file(dstfd, srcfd))
+ op = US"creating";
+ else
+ return TRUE;
+ }
addr->basic_errno = errno;
addr->message = string_sprintf("%s transport %s file: %s failed with error: %s",
put in the first address of a batch. */
return FALSE;
}
+
+#endif /*!MACRO_PREDEF*/