summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/s_server.c
diff options
context:
space:
mode:
authorbcook <>2014-10-13 02:39:09 +0000
committerbcook <>2014-10-13 02:39:09 +0000
commit7b944af97196f9b4b28af3b73db474a465f413a6 (patch)
tree70c469b77c3b1769a4552537e8f7a18cbb3e5ef8 /src/usr.bin/openssl/s_server.c
parent188e36185aae11a52b07f29de8b1334484bac87e (diff)
downloadopenbsd-7b944af97196f9b4b28af3b73db474a465f413a6.tar.gz
openbsd-7b944af97196f9b4b28af3b73db474a465f413a6.tar.bz2
openbsd-7b944af97196f9b4b28af3b73db474a465f413a6.zip
Use O_NONBLOCK over FIONBIO.
Prefer this because it is the POSIX standard and has consistent behavior across platforms. Use BIO_socket_nbio consistently across the tree. from Jonas 'Sortie' Termansen, ok deraadt@
Diffstat (limited to 'src/usr.bin/openssl/s_server.c')
-rw-r--r--src/usr.bin/openssl/s_server.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/usr.bin/openssl/s_server.c b/src/usr.bin/openssl/s_server.c
index 7fa875c661..9ca13dd335 100644
--- a/src/usr.bin/openssl/s_server.c
+++ b/src/usr.bin/openssl/s_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_server.c,v 1.1 2014/08/26 17:47:25 jsing Exp $ */ 1/* $OpenBSD: s_server.c,v 1.2 2014/10/13 02:39:09 bcook Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1364,11 +1364,9 @@ sv_body(char *hostname, int s, unsigned char *context)
1364 goto err; 1364 goto err;
1365 } 1365 }
1366 if (s_nbio) { 1366 if (s_nbio) {
1367 unsigned long sl = 1;
1368
1369 if (!s_quiet) 1367 if (!s_quiet)
1370 BIO_printf(bio_err, "turning on non blocking io\n"); 1368 BIO_printf(bio_err, "turning on non blocking io\n");
1371 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) 1369 if (!BIO_socket_nbio(s, 1))
1372 ERR_print_errors(bio_err); 1370 ERR_print_errors(bio_err);
1373 } 1371 }
1374 1372
@@ -1798,11 +1796,9 @@ www_body(char *hostname, int s, unsigned char *context)
1798 goto err; 1796 goto err;
1799 1797
1800 if (s_nbio) { 1798 if (s_nbio) {
1801 unsigned long sl = 1;
1802
1803 if (!s_quiet) 1799 if (!s_quiet)
1804 BIO_printf(bio_err, "turning on non blocking io\n"); 1800 BIO_printf(bio_err, "turning on non blocking io\n");
1805 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) 1801 if (!BIO_socket_nbio(s, 1))
1806 ERR_print_errors(bio_err); 1802 ERR_print_errors(bio_err);
1807 } 1803 }
1808 1804