summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2006-04-17 12:22:13 +0000
committerDr. Stephen Henson <steve@openssl.org>2006-04-17 12:22:13 +0000
commit7bf7333d688264f6d389c1c3c87c127f484b2efa (patch)
treed777c6c566351367c8e0996fc7e162e18541f67a
parentc20276e4aef1e716980589c43cf9276abc7ff2b7 (diff)
If we include winsock2.h then FD_SET wants an unsigned type for an fd.
-rw-r--r--apps/apps.h7
-rw-r--r--apps/s_client.c12
-rw-r--r--apps/s_server.c4
-rw-r--r--apps/s_time.c2
4 files changed, 16 insertions, 9 deletions
diff --git a/apps/apps.h b/apps/apps.h
index 00522341ff..3b5febac7d 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -193,6 +193,13 @@ extern BIO *bio_err;
# endif
#endif
+#ifdef OPENSSL_SYSNAME_WIN32
+# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
+#else
+# define openssl_fdset(a,b) FD_SET(a, b)
+#endif
+
+
typedef struct args_st
{
char **data;
diff --git a/apps/s_client.c b/apps/s_client.c
index 93e640c463..8eeb726981 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -959,19 +959,19 @@ re_start:
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5)
if (tty_on)
{
- if (read_tty) FD_SET(fileno(stdin),&readfds);
- if (write_tty) FD_SET(fileno(stdout),&writefds);
+ if (read_tty) openssl_fdset(fileno(stdin),&readfds);
+ if (write_tty) openssl_fdset(fileno(stdout),&writefds);
}
if (read_ssl)
- FD_SET(SSL_get_fd(con),&readfds);
+ openssl_fdset(SSL_get_fd(con),&readfds);
if (write_ssl)
- FD_SET(SSL_get_fd(con),&writefds);
+ openssl_fdset(SSL_get_fd(con),&writefds);
#else
if(!tty_on || !write_tty) {
if (read_ssl)
- FD_SET(SSL_get_fd(con),&readfds);
+ openssl_fdset(SSL_get_fd(con),&readfds);
if (write_ssl)
- FD_SET(SSL_get_fd(con),&writefds);
+ openssl_fdset(SSL_get_fd(con),&writefds);
}
#endif
/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
diff --git a/apps/s_server.c b/apps/s_server.c
index 69a2f6caf4..a294ed343d 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -1621,9 +1621,9 @@ static int sv_body(char *hostname, int s, unsigned char *context)
{
FD_ZERO(&readfds);
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5)
- FD_SET(fileno(stdin),&readfds);
+ openssl_fdset(fileno(stdin),&readfds);
#endif
- FD_SET(s,&readfds);
+ openssl_fdset(s,&readfds);
/* Note: under VMS with SOCKETSHR the second parameter is
* currently of type (int *) whereas under other systems
* it is (void *) if you don't have a cast it will choke
diff --git a/apps/s_time.c b/apps/s_time.c
index 33e312bab4..b823c33c58 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -601,7 +601,7 @@ static SSL *doConnection(SSL *scon)
i=SSL_get_fd(serverCon);
width=i+1;
FD_ZERO(&readfds);
- FD_SET(i,&readfds);
+ openssl_fdset(i,&readfds);
/* Note: under VMS with SOCKETSHR the 2nd parameter
* is currently of type (int *) whereas under other
* systems it is (void *) if you don't have a cast it