int BIO_sock_error(int sock)
{
int j = 0, i;
- socklen_t size = 0;
+ socklen_t size = sizeof(j);
/*
* Note: under Windows the third parameter is of type (char *) whereas
*/
i = getsockopt(sock, SOL_SOCKET, SO_ERROR, (void *)&j, &size);
if (i < 0)
- return (1);
+ return (get_last_socket_error());
else
return (j);
}
return (1);
}
-void BIO_sock_cleanup(void)
+void bio_sock_cleanup_int(void)
{
# ifdef OPENSSL_SYS_WINDOWS
if (wsa_init_done) {