aboutsummaryrefslogtreecommitdiff
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r--crypto/bio/b_sock.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index bda882c40b08..5bad0a2bada2 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -225,13 +225,17 @@ int BIO_get_port(const char *str, unsigned short *port_ptr)
int BIO_sock_error(int sock)
{
int j, i;
- int size;
+ union {
+ size_t s;
+ int i;
+ } size;
# if defined(OPENSSL_SYS_BEOS_R5)
return 0;
# endif
- size = sizeof(int);
+ /* heuristic way to adapt for platforms that expect 64-bit optlen */
+ size.s = 0, size.i = sizeof(j);
/*
* Note: under Windows the third parameter is of type (char *) whereas
* under other systems it is (void *) if you don't have a cast it will