diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-06-14 01:44:40 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-06-14 01:44:40 +0000 |
commit | 3ec00ea296b0b8b45ad76fde1c40c6f2d817bf03 (patch) | |
tree | e54f993cfd260a4e6dddfb45ebe61349d2c23254 /usr.bin/ssh/channels.c | |
parent | 9e793891f82f664eaac51d261d2999d482ec47f2 (diff) |
set_nonblock() instead of fnctl(...,O_NONBLOCK); "looks sane" deraadt@
Diffstat (limited to 'usr.bin/ssh/channels.c')
-rw-r--r-- | usr.bin/ssh/channels.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index 364863011b5..1a39dcffb20 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.204 2004/06/13 15:03:02 djm Exp $"); +RCSID("$OpenBSD: channels.c,v 1.205 2004/06/14 01:44:38 djm Exp $"); #include "ssh.h" #include "ssh1.h" @@ -2497,8 +2497,8 @@ connect_to(const char *host, u_short port) verbose("socket: %.100s", strerror(errno)); continue; } - if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) - fatal("connect_to: F_SETFL: %s", strerror(errno)); + if (set_nonblock(sock) == -1) + fatal("%s: set_nonblock(%d)", __func__, sock); if (connect(sock, ai->ai_addr, ai->ai_addrlen) < 0 && errno != EINPROGRESS) { error("connect_to %.100s port %s: %.100s", ntop, strport, |