comparison svr-chansession.c @ 109:2e9d1f29c50f

merge of 50be59810e462f9f44f55e421227d6aa0b31982b and 69b007796063cb5f042be7cca2d479e90db869c3
author Matt Johnston <matt@ucc.asn.au>
date Fri, 27 Aug 2004 14:39:01 +0000
parents 10f4d3319780
children 9ffe5a6dbf3f
comparison
equal deleted inserted replaced
108:10f4d3319780 109:2e9d1f29c50f
649 channel->errfd = errfds[FDIN]; 649 channel->errfd = errfds[FDIN];
650 ses.maxfd = MAX(ses.maxfd, channel->infd); 650 ses.maxfd = MAX(ses.maxfd, channel->infd);
651 ses.maxfd = MAX(ses.maxfd, channel->outfd); 651 ses.maxfd = MAX(ses.maxfd, channel->outfd);
652 ses.maxfd = MAX(ses.maxfd, channel->errfd); 652 ses.maxfd = MAX(ses.maxfd, channel->errfd);
653 653
654 if ((fcntl(channel->outfd, F_SETFL, O_NONBLOCK) < 0) || 654 setnonblocking(channel->outfd);
655 (fcntl(channel->infd, F_SETFL, O_NONBLOCK) < 0) || 655 setnonblocking(channel->infd);
656 (fcntl(channel->errfd, F_SETFL, O_NONBLOCK) < 0)) { 656 setnonblocking(channel->errfd);
657 dropbear_exit("Couldn't set nonblocking"); 657
658 }
659 } 658 }
660 #undef FDIN 659 #undef FDIN
661 #undef FDOUT 660 #undef FDOUT
662 661
663 TRACE(("leave noptycommand")); 662 TRACE(("leave noptycommand"));
759 channel->infd = chansess->master; 758 channel->infd = chansess->master;
760 channel->outfd = chansess->master; 759 channel->outfd = chansess->master;
761 /* don't need to set stderr here */ 760 /* don't need to set stderr here */
762 ses.maxfd = MAX(ses.maxfd, chansess->master); 761 ses.maxfd = MAX(ses.maxfd, chansess->master);
763 762
764 if (fcntl(chansess->master, F_SETFL, O_NONBLOCK) < 0) { 763 setnonblocking(chansess->master);
765 dropbear_exit("Couldn't set nonblocking");
766 }
767 764
768 } 765 }
769 766
770 TRACE(("leave ptycommand")); 767 TRACE(("leave ptycommand"));
771 return DROPBEAR_SUCCESS; 768 return DROPBEAR_SUCCESS;