=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.556 retrieving revision 1.557 diff -u -r1.556 -r1.557 --- src/usr.bin/ssh/ssh.c 2021/05/17 11:43:16 1.556 +++ src/usr.bin/ssh/ssh.c 2021/05/19 01:24:05 1.557 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.556 2021/05/17 11:43:16 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.557 2021/05/19 01:24:05 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1855,9 +1855,10 @@ if ((in = dup(STDIN_FILENO)) == -1 || (out = dup(STDOUT_FILENO)) == -1) - fatal("channel_connect_stdio_fwd: dup() in/out failed"); + fatal_f("dup() in/out failed"); if ((c = channel_connect_stdio_fwd(ssh, options.stdio_forward_host, - options.stdio_forward_port, in, out)) == NULL) + options.stdio_forward_port, in, out, + CHANNEL_NONBLOCK_STDIO)) == NULL) fatal_f("channel_connect_stdio_fwd failed"); channel_register_cleanup(ssh, c->self, client_cleanup_stdio_fwd, 0); channel_register_open_confirm(ssh, c->self, ssh_stdio_confirm, NULL); @@ -2053,14 +2054,6 @@ if (in == -1 || out == -1 || err == -1) fatal("dup() in/out/err failed"); - /* enable nonblocking unless tty */ - if (!isatty(in)) - set_nonblock(in); - if (!isatty(out)) - set_nonblock(out); - if (!isatty(err)) - set_nonblock(err); - window = CHAN_SES_WINDOW_DEFAULT; packetmax = CHAN_SES_PACKET_DEFAULT; if (tty_flag) { @@ -2070,7 +2063,7 @@ c = channel_new(ssh, "session", SSH_CHANNEL_OPENING, in, out, err, window, packetmax, CHAN_EXTENDED_WRITE, - "client-session", /*nonblock*/0); + "client-session", CHANNEL_NONBLOCK_STDIO); debug3_f("channel_new: %d", c->self);