summaryrefslogtreecommitdiff
path: root/common-channel.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-12-06 17:32:53 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-12-06 17:32:53 +0000
commitb7a9d0211b58e712abfcecaf181e1c3864763e26 (patch)
tree247bc4320c7be75b29e5956b5048a52bc6a86f18 /common-channel.c
parent20c90f8f666f20ea0c8ebdbbc0c397cd79d9455b (diff)
downloaddropbear-b7a9d0211b58e712abfcecaf181e1c3864763e26.tar.gz
* common-channel.c: get rid of the read()-from-writefd code
which caused problems when redirecting to or from /dev/null
Diffstat (limited to 'common-channel.c')
-rw-r--r--common-channel.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/common-channel.c b/common-channel.c
index 54829e5..7e8d428 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -203,24 +203,6 @@ void channelio(fd_set *readfds, fd_set *writefds) {
send_msg_channel_data(channel, 1, SSH_EXTENDED_DATA_STDERR);
}
- /* if we can read from the writefd, it might be closed, so we try to
- * see if it has errors */
- if (channel->writefd >= 0 && channel->writefd != channel->readfd
- && FD_ISSET(channel->writefd, readfds)) {
- if (channel->initconn) {
- /* Handling for "in progress" connection - this is needed
- * to avoid spinning 100% CPU when we connect to a server
- * which doesn't send anything (tcpfwding) */
- checkinitdone(channel);
- continue; /* Important not to use the channel after
- checkinitdone(), as it may be NULL */
- }
- ret = write(channel->writefd, NULL, 0); /* Fake write */
- if (ret < 0 && errno != EINTR && errno != EAGAIN) {
- closewritefd(channel);
- }
- }
-
/* write to program/pipe stdin */
if (channel->writefd >= 0 && FD_ISSET(channel->writefd, writefds)) {
if (channel->initconn) {
@@ -445,17 +427,7 @@ void setchannelfds(fd_set *readfds, fd_set *writefds) {
}
}
- /* For checking FD status (ie closure etc) - we don't actually
- * read data from writefd */
- TRACE(("writefd = %d, readfd %d, errfd %d, bufused %d",
- channel->writefd, channel->readfd,
- channel->errfd,
- cbuf_getused(channel->writebuf) ))
- if (channel->writefd >= 0 && channel->writefd != channel->readfd) {
- FD_SET(channel->writefd, readfds);
- }
-
- /* Stuff from the wire, to local program/shell/user etc */
+ /* Stuff from the wire */
if ((channel->writefd >= 0 && cbuf_getused(channel->writebuf) > 0 )
|| channel->initconn) {