X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Ftransport.c;h=2d8426f297acfadfe03dfe432e826ddc8261c77e;hb=19849de0dd5a6cf2ec8344a8adef9a433d7e7cf1;hp=142fede070f7ce0fcb53516989f9f7d016f8635a;hpb=96c8151125ceb98ed52c0089f6401e6ba05bb41e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/transport.c b/src/src/transport.c index 142fede07..2d8426f29 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -3,6 +3,7 @@ *************************************************/ /* Copyright (c) University of Cambridge 1995 - 2018 */ +/* Copyright (c) The Exim Maintainers 2020 */ /* See the file NOTICE for conditions of use and distribution. */ /* General functions concerned with transportation, and generic options for all @@ -265,6 +266,7 @@ for (int i = 0; i < 100; i++) } else /* Timeout wanted. */ { + sigalrm_seen = FALSE; ALARM(local_timeout); rc = tpt_write(fd, block, len, more, tctx->options); save_errno = errno; @@ -1233,10 +1235,10 @@ write_pid = (pid_t)(-1); { int bits = fcntl(tctx->u.fd, F_GETFD); - (void)fcntl(tctx->u.fd, F_SETFD, bits | FD_CLOEXEC); + (void) fcntl(tctx->u.fd, F_SETFD, bits | FD_CLOEXEC); filter_pid = child_open(USS transport_filter_argv, NULL, 077, - &fd_write, &fd_read, FALSE); - (void)fcntl(tctx->u.fd, F_SETFD, bits & ~FD_CLOEXEC); + &fd_write, &fd_read, FALSE, US"transport-filter"); + (void) fcntl(tctx->u.fd, F_SETFD, bits & ~FD_CLOEXEC); } if (filter_pid < 0) goto TIDY_UP; /* errno set */ @@ -1249,7 +1251,7 @@ via a(nother) pipe. While writing to the filter, we do not do the CRLF, smtp dots, or check string processing. */ if (pipe(pfd) != 0) goto TIDY_UP; /* errno set */ -if ((write_pid = exim_fork(US"transport filter writer")) == 0) +if ((write_pid = exim_fork(US"tpt-filter-writer")) == 0) { BOOL rc; (void)close(fd_read); @@ -1273,7 +1275,7 @@ if ((write_pid = exim_fork(US"transport filter writer")) == 0) != sizeof(struct timeval) ) rc = FALSE; /* compiler quietening */ - exim_underbar_exit(0, US"tpt-filter writer"); + exim_underbar_exit(EXIT_SUCCESS); } save_errno = errno; @@ -1957,7 +1959,7 @@ int status; DEBUG(D_transport) debug_printf("transport_pass_socket entered\n"); -if ((pid = exim_fork(US"continued-transport interproc")) == 0) +if ((pid = exim_fork(US"continued-transport-interproc")) == 0) { /* Disconnect entirely from the parent process. If we are running in the test harness, wait for a bit to allow the previous process time to finish, @@ -1965,10 +1967,7 @@ if ((pid = exim_fork(US"continued-transport interproc")) == 0) automatic comparison. */ if ((pid = exim_fork(US"continued-transport")) != 0) - { - DEBUG(D_transport) debug_printf("transport_pass_socket succeeded (final-pid %d)\n", pid); _exit(EXIT_SUCCESS); - } testharness_pause_ms(1000); transport_do_pass_socket(transport_name, hostname, hostaddress, @@ -1983,7 +1982,6 @@ if (pid > 0) { int rc; while ((rc = wait(&status)) != pid && (rc >= 0 || errno != ECHILD)); - DEBUG(D_transport) debug_printf("transport_pass_socket succeeded (inter-pid %d)\n", pid); return TRUE; } else