diff options
author | 2001-04-15 17:16:00 +0000 | |
---|---|---|
committer | 2001-04-15 17:16:00 +0000 | |
commit | e33041eb1dacbb3675a10d0eaddd08b58251f2c5 (patch) | |
tree | 4243697cedab69d43f1bdf1dd1ccd2e1d34dd038 /usr.bin/ssh/clientloop.c | |
parent | don't use errno for key_{load,save}_private; discussion w/ solar@openwall (diff) | |
download | wireguard-openbsd-e33041eb1dacbb3675a10d0eaddd08b58251f2c5.tar.xz wireguard-openbsd-e33041eb1dacbb3675a10d0eaddd08b58251f2c5.zip |
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/clientloop.c')
-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)); |