X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsrc%2Ftransports%2Fqueuefile.c;h=c6db3ac50cf64f71b7f191914026fbc66d808925;hb=f9ba5e2255cf18092750fffacb6a9603571a2be5;hp=25747b3ab9cb2411a1b69cec5b7ec7f9fdc0d3eb;hpb=b47584259a53dcd166b923520a3ba7d8df0eb5bc;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/transports/queuefile.c b/src/src/transports/queuefile.c index 25747b3ab..c6db3ac50 100644 --- a/src/src/transports/queuefile.c +++ b/src/src/transports/queuefile.c @@ -4,6 +4,7 @@ /* Copyright (c) Andrew Colin Kissa 2016 */ /* Copyright (c) University of Cambridge 2016 */ +/* Copyright (c) The Exim Maintainers 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -20,12 +21,25 @@ optionlist queuefile_transport_options[] = { (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 = { @@ -116,29 +130,29 @@ if (link_file) 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", @@ -254,3 +268,5 @@ if (sdfd >= 0) (void) close(sdfd); put in the first address of a batch. */ return FALSE; } + +#endif /*!MACRO_PREDEF*/