diff 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
line wrap: on
line diff
--- a/svr-chansession.c	Thu Aug 26 13:16:40 2004 +0000
+++ b/svr-chansession.c	Fri Aug 27 14:39:01 2004 +0000
@@ -651,11 +651,10 @@
 		ses.maxfd = MAX(ses.maxfd, channel->outfd);
 		ses.maxfd = MAX(ses.maxfd, channel->errfd);
 
-		if ((fcntl(channel->outfd, F_SETFL, O_NONBLOCK) < 0) ||
-			(fcntl(channel->infd, F_SETFL, O_NONBLOCK) < 0) ||
-			(fcntl(channel->errfd, F_SETFL, O_NONBLOCK) < 0)) {
-			dropbear_exit("Couldn't set nonblocking");
-		}
+		setnonblocking(channel->outfd);
+		setnonblocking(channel->infd);
+		setnonblocking(channel->errfd);
+
 	}
 #undef FDIN
 #undef FDOUT
@@ -761,9 +760,7 @@
 		/* don't need to set stderr here */
 		ses.maxfd = MAX(ses.maxfd, chansess->master);
 
-		if (fcntl(chansess->master, F_SETFL, O_NONBLOCK) < 0) {
-			dropbear_exit("Couldn't set nonblocking");
-		}
+		setnonblocking(chansess->master);
 
 	}