From 3c4f9ed04571246b40ec71bad031e485604c5553 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Tue, 4 Nov 2014 18:15:22 +0000 Subject: simple select() to poll() conversion; reviewed by millert and doug --- src/usr.bin/openssl/s_time.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/usr.bin/openssl/s_time.c b/src/usr.bin/openssl/s_time.c index 7279883c87..fdbf1385a1 100644 --- a/src/usr.bin/openssl/s_time.c +++ b/src/usr.bin/openssl/s_time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_time.c,v 1.2 2014/09/01 20:54:37 doug Exp $ */ +/* $OpenBSD: s_time.c,v 1.3 2014/11/04 18:15:22 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -63,7 +63,7 @@ Written and donated by Larry Streepy -----------------------------------------*/ -#include +#include #include #include @@ -71,6 +71,7 @@ #include #include #include +#include #include "apps.h" @@ -530,10 +531,10 @@ end: static SSL * doConnection(SSL * scon) { - BIO *conn; + struct pollfd pfd[1]; SSL *serverCon; - int width, i; - fd_set readfds; + BIO *conn; + int i; if ((conn = BIO_new(BIO_s_connect())) == NULL) return (NULL); @@ -562,10 +563,9 @@ doConnection(SSL * scon) BIO_printf(bio_err, "DELAY\n"); i = SSL_get_fd(serverCon); - width = i + 1; - FD_ZERO(&readfds); - FD_SET(i, &readfds); - select(width, &readfds, NULL, NULL, NULL); + pfd[0].fd = i; + pfd[0].events = POLLIN; + poll(pfd, 1, -1); continue; } break; -- cgit v1.2.3-55-g6feb