summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2014-11-04 18:15:22 +0000
committerderaadt <>2014-11-04 18:15:22 +0000
commit3c4f9ed04571246b40ec71bad031e485604c5553 (patch)
treeafc0a19e408210216b709a38a0336dcfac559b9f
parentad2f06264126db0b9f2e92eec0fe2e8365c1c4d1 (diff)
downloadopenbsd-3c4f9ed04571246b40ec71bad031e485604c5553.tar.gz
openbsd-3c4f9ed04571246b40ec71bad031e485604c5553.tar.bz2
openbsd-3c4f9ed04571246b40ec71bad031e485604c5553.zip
simple select() to poll() conversion; reviewed by millert and doug
-rw-r--r--src/usr.bin/openssl/s_time.c18
1 files changed, 9 insertions, 9 deletions
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 @@
1/* $OpenBSD: s_time.c,v 1.2 2014/09/01 20:54:37 doug Exp $ */ 1/* $OpenBSD: s_time.c,v 1.3 2014/11/04 18:15:22 deraadt 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 *
@@ -63,7 +63,7 @@
63 Written and donated by Larry Streepy <streepy@healthcare.com> 63 Written and donated by Larry Streepy <streepy@healthcare.com>
64 -----------------------------------------*/ 64 -----------------------------------------*/
65 65
66#include <sys/select.h> 66#include <sys/types.h>
67#include <sys/socket.h> 67#include <sys/socket.h>
68 68
69#include <stdio.h> 69#include <stdio.h>
@@ -71,6 +71,7 @@
71#include <limits.h> 71#include <limits.h>
72#include <string.h> 72#include <string.h>
73#include <unistd.h> 73#include <unistd.h>
74#include <poll.h>
74 75
75#include "apps.h" 76#include "apps.h"
76 77
@@ -530,10 +531,10 @@ end:
530static SSL * 531static SSL *
531doConnection(SSL * scon) 532doConnection(SSL * scon)
532{ 533{
533 BIO *conn; 534 struct pollfd pfd[1];
534 SSL *serverCon; 535 SSL *serverCon;
535 int width, i; 536 BIO *conn;
536 fd_set readfds; 537 int i;
537 538
538 if ((conn = BIO_new(BIO_s_connect())) == NULL) 539 if ((conn = BIO_new(BIO_s_connect())) == NULL)
539 return (NULL); 540 return (NULL);
@@ -562,10 +563,9 @@ doConnection(SSL * scon)
562 BIO_printf(bio_err, "DELAY\n"); 563 BIO_printf(bio_err, "DELAY\n");
563 564
564 i = SSL_get_fd(serverCon); 565 i = SSL_get_fd(serverCon);
565 width = i + 1; 566 pfd[0].fd = i;
566 FD_ZERO(&readfds); 567 pfd[0].events = POLLIN;
567 FD_SET(i, &readfds); 568 poll(pfd, 1, -1);
568 select(width, &readfds, NULL, NULL, NULL);
569 continue; 569 continue;
570 } 570 }
571 break; 571 break;