if ((pid = fork()) < 0)
goto fail;
- else if (pid == 0) /* child */
+ else if (pid == 0) /* child: fork again to totally dosconnect */
{
+ if ((pid = fork()))
+ _exit(pid ? EXIT_FAILURE : EXIT_SUCCESS);
smtp_proxy_tls(big_buffer, big_buffer_size, pfd[0], 5*60);
exim_exit(0);
}
+ waitpid(pid, NULL, 0);
(void) close(channel_fd); /* release the client socket */
channel_fd = pfd[1];
}
int pid = fork();
if (pid > 0) /* parent */
{
+ waitpid(pid, NULL, 0);
tls_close(FALSE, FALSE);
(void)close(sx.inblock.sock);
continue_transport = NULL;
continue_hostname = NULL;
return yield;
}
- else if (pid == 0) /* child */
+ else if (pid == 0) /* child; fork again to disconnect totally */
{
+ if ((pid = fork()))
+ _exit(pid ? EXIT_FAILURE : EXIT_SUCCESS);
smtp_proxy_tls(sx.buffer, sizeof(sx.buffer), pfd[0], sx.ob->command_timeout);
exim_exit(0);
}