diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-04-15 17:16:01 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-04-15 17:16:01 +0000 |
commit | d324ab9f5da1c1328c1599879e4b95dfd4497dcf (patch) | |
tree | f96bb4a539a26a917ddd5ba233f06e96d620dfc5 /usr.bin/ssh | |
parent | 8747aa7bf85d9c847c2cb2438bbb876c6faa7667 (diff) |
set stdin/out/err to nonblocking in SSH proto 1, too. suggested by ho@
should fix some of the blocking problems for rsync over SSH-1
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 24ea0dec0e1..95c00f3431d 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.62 2001/04/14 16:33:20 stevesk Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.63 2001/04/15 17:16:00 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -80,6 +80,7 @@ RCSID("$OpenBSD: clientloop.c,v 1.62 2001/04/14 16:33:20 stevesk Exp $"); #include "authfd.h" #include "atomicio.h" #include "sshtty.h" +#include "misc.h" /* import options */ extern Options options; @@ -782,6 +783,13 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) max_fd = MAX(connection_in, connection_out); if (!compat20) { + /* enable nonblocking unless tty */ + if (!isatty(fileno(stdin))) + set_nonblock(fileno(stdin)); + if (!isatty(fileno(stdout))) + set_nonblock(fileno(stdout)); + if (!isatty(fileno(stderr))) + set_nonblock(fileno(stderr)); max_fd = MAX(max_fd, fileno(stdin)); max_fd = MAX(max_fd, fileno(stdout)); max_fd = MAX(max_fd, fileno(stderr)); |