Verified Commit 5ab9c29f authored by jD91mZM2's avatar jD91mZM2

Workaround for BIO_socket_nbio on relibc

See https://github.com/openssl/openssl/issues/4029
parent 2b8631ec
......@@ -318,12 +318,12 @@ int BIO_socket_nbio(int s, int mode)
l = mode;
ret = BIO_socket_ioctl(s, FIONBIO, &l);
# elif defined(F_GETFL) && defined(F_SETFL) && (defined(O_NONBLOCK) || defined(FNDELAY))
# elif 1 // defined(F_GETFL) && defined(F_SETFL) && (defined(O_NONBLOCK) || defined(FNDELAY))
/* make sure this call always pushes an error level; BIO_socket_ioctl() does so, so we do too. */
l = fcntl(s, F_GETFL, 0);
if (l == -1) {
SYSerr(SYS_F_FCNTL, get_last_rtl_error());
SYSerr(SYS_F_FCNTL, get_last_socket_error());
ret = -1;
} else {
# if defined(O_NONBLOCK)
......@@ -341,7 +341,7 @@ int BIO_socket_nbio(int s, int mode)
ret = fcntl(s, F_SETFL, l);
if (ret < 0) {
SYSerr(SYS_F_FCNTL, get_last_rtl_error());
SYSerr(SYS_F_FCNTL, get_last_socket_error());
}
}
# else
......
......@@ -13,6 +13,7 @@
# include <openssl/opensslconf.h>
# include <sys/un.h>
# include <sys/select.h>
# include <fcntl.h>
# include <openssl/e_os2.h>
/*
......
......@@ -159,6 +159,7 @@ typedef struct err_state_st {
# define SYS_F_GETSOCKOPT 15
# define SYS_F_GETSOCKNAME 16
# define SYS_F_GETHOSTBYNAME 17
# define SYS_F_FCNTL 18
/* reasons */
# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment