diff options
author | 2001-05-16 22:09:20 +0000 | |
---|---|---|
committer | 2001-05-16 22:09:20 +0000 | |
commit | dbbed1e974960c598e53b0c62fca924638ff5bce (patch) | |
tree | b680bf601be58c3b3fe6770bf6e5fe8240f91edf /usr.bin/ssh/channels.c | |
parent | check for open sessions before we call select(); fixes the x11 client (diff) | |
download | wireguard-openbsd-dbbed1e974960c598e53b0c62fca924638ff5bce.tar.xz wireguard-openbsd-dbbed1e974960c598e53b0c62fca924638ff5bce.zip |
more select() error fixes (don't set rfd/wfd to -1).
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r-- | usr.bin/ssh/channels.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index f7e73dd28f5..48f5f58d62c 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.115 2001/05/09 22:51:57 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.116 2001/05/16 22:09:20 markus Exp $"); #include <openssl/rsa.h> #include <openssl/dsa.h> @@ -893,7 +893,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset) char buf[16*1024]; int len; - if (c->rfd != -1 && + if (c->istate == CHAN_INPUT_OPEN && FD_ISSET(c->rfd, readset)) { len = read(c->rfd, buf, sizeof(buf)); if (len < 0 && (errno == EINTR || errno == EAGAIN)) @@ -932,7 +932,8 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset) int len; /* Send buffered output data to the socket. */ - if (c->wfd != -1 && + if ((c->ostate == CHAN_OUTPUT_OPEN || + c->ostate == CHAN_OUTPUT_WAIT_DRAIN) && FD_ISSET(c->wfd, writeset) && buffer_len(&c->output) > 0) { len = write(c->wfd, buffer_ptr(&c->output), |