summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-04-16 02:01:25 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-04-16 02:01:25 +0000
commit302ea6f2f919acb2727a21f2c2c5e86bfed6053a (patch)
treecd45f8c863c5b7016c06e536905268900a3aea72 /clientloop.c
parent15f33866a6fb9e67f2a89f5edc8b8c7635f6d984 (diff)
- markus@cvs.openbsd.org 2001/04/15 17:16:00
[clientloop.c] 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 'clientloop.c')
-rw-r--r--clientloop.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clientloop.c b/clientloop.c
index 24ea0dec..95c00f34 100644
--- a/clientloop.c
+++ b/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));