diff svr-chansession.c @ 1829:a7cc3332d8ab

Replace ChanType.sepfds with Channel.bidir_fd This handles the case where a svrchansess has separate FDs for nopty, but a single FD for pty mode. The use of sepfds was also previously incorrect for X11 and agent forwarding
author Matt Johnston <matt@ucc.asn.au>
date Mon, 11 Oct 2021 15:42:14 +0800
parents 3f0ac6bc58a1
children c32976db772f
line wrap: on
line diff
--- a/svr-chansession.c	Mon Oct 11 15:16:54 2021 +0800
+++ b/svr-chansession.c	Mon Oct 11 15:42:14 2021 +0800
@@ -64,7 +64,6 @@
 static void get_termmodes(const struct ChanSess *chansess);
 
 const struct ChanType svrchansess = {
-	0, /* sepfds */
 	"session", /* name */
 	newchansess, /* inithandler */
 	sesscheckclose, /* checkclosehandler */
@@ -769,6 +768,7 @@
 	ses.maxfd = MAX(ses.maxfd, channel->writefd);
 	ses.maxfd = MAX(ses.maxfd, channel->readfd);
 	ses.maxfd = MAX(ses.maxfd, channel->errfd);
+	channel->bidir_fd = 0;
 
 	addchildpid(chansess, chansess->pid);
 
@@ -895,6 +895,7 @@
 		channel->readfd = chansess->master;
 		/* don't need to set stderr here */
 		ses.maxfd = MAX(ses.maxfd, chansess->master);
+		channel->bidir_fd = 1;
 
 		setnonblocking(chansess->master);