[exim-cvs] Fix Solaris build

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Fix Solaris build
Gitweb: https://git.exim.org/exim.git/commitdiff/a243c20fbe33a8eb196f1447816c491bfdd7128d
Commit:     a243c20fbe33a8eb196f1447816c491bfdd7128d
Parent:     e94c0fe42ba93c2643d44046f2f3a269bae41290
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue Nov 26 10:44:15 2024 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue Nov 26 10:44:15 2024 +0000


    Fix Solaris build
---
 src/src/atrn.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)


diff --git a/src/src/atrn.c b/src/src/atrn.c
index 9e9c1e1d8..326e32328 100644
--- a/src/src/atrn.c
+++ b/src/src/atrn.c
@@ -120,10 +120,18 @@ if (rc == DEFER)

/* Flip the connection around */

+fflush(stdin);
+fflush(stdout);
force_fd(cutthrough.cctx.sock, 0);
(void)dup2(0, 1);
-stdin = fdopen(0, "r");
-stdout = fdopen(1, "w");
+
+/* Really should re-open the stdio streams on the new fd's to ensure all
+the invisible stdio state is proper - but there seems no way to do that.
+You cannot assign to std{in,out}, they being macros (per Posix), so fdopen()
+is out. freopen() requires a filesystem name, and we don't have one and cannot
+portably invent one for a socket. We'd have to stop using std{in,out} for
+Exim's server side entirely (we use bare fd's for client-side i/o already). */
+
#ifndef DISABLE_TLS
if (tls_out.active.sock >= 0)
tls_state_out_to_in(0, cutthrough.host.address, cutthrough.host.port);

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/