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/sshd.c | |
parent | 9e793891f82f664eaac51d261d2999d482ec47f2 (diff) |
set_nonblock() instead of fnctl(...,O_NONBLOCK); "looks sane" deraadt@
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r-- | usr.bin/ssh/sshd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 3d718295b9e..fb7208c4936 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.292 2004/06/13 12:53:24 djm Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.293 2004/06/14 01:44:39 djm Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -1072,8 +1072,7 @@ main(int ac, char **av) verbose("socket: %.100s", strerror(errno)); continue; } - if (fcntl(listen_sock, F_SETFL, O_NONBLOCK) < 0) { - error("listen_sock O_NONBLOCK: %s", strerror(errno)); + if (set_nonblock(listen_sock) == -1) { close(listen_sock); continue; } @@ -1215,8 +1214,7 @@ main(int ac, char **av) error("accept: %.100s", strerror(errno)); continue; } - if (fcntl(newsock, F_SETFL, 0) < 0) { - error("newsock del O_NONBLOCK: %s", strerror(errno)); + if (unset_nonblock(newsock) == -1) { close(newsock); continue; } |