went back to non-blokcing IO

it looks like ssh is willing to accept a non-blocking fd when used as
a transport, this seems to avoid the Solaris socketpair bug
This commit is contained in:
Andrew Tridgell
2000-03-30 14:15:00 +00:00
parent ef55c686bc
commit f0359dd00d
6 changed files with 66 additions and 6 deletions

12
io.c
View File

@@ -159,6 +159,11 @@ static int read_timeout(int fd, char *buf, int len)
continue;
}
if (n == -1 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
continue;
}
if (n == 0) {
if (eof_error) {
@@ -364,12 +369,17 @@ static void writefd_unbuffered(int fd,char *buf,int len)
if (FD_ISSET(fd, &w_fds)) {
int ret, n = len-total;
ret = write(fd,buf+total,n?n:1);
ret = write(fd,buf+total,n);
if (ret == -1 && errno == EINTR) {
continue;
}
if (ret == -1 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
continue;
}
if (ret <= 0) {
rprintf(FERROR,"erroring writing %d bytes - exiting\n", len);
exit_cleanup(RERR_STREAMIO);