summaryrefslogtreecommitdiffhomepage
path: root/svr-chansession.c
diff options
context:
space:
mode:
Diffstat (limited to 'svr-chansession.c')
-rw-r--r--svr-chansession.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/svr-chansession.c b/svr-chansession.c
index 8c9fa3b..be6678d 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -651,11 +651,10 @@ static int noptycommand(struct Channel *channel, struct ChanSess *chansess) {
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 @@ static int ptycommand(struct Channel *channel, struct ChanSess *chansess) {
/* 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);
}