mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
src/wolfio.c: protect __GLIBC__ comparison with defined(__GLIBC__).
This commit is contained in:
@ -813,7 +813,8 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
|
|||||||
char strPort[6];
|
char strPort[6];
|
||||||
#else
|
#else
|
||||||
#if !defined(WOLFSSL_USE_POPEN_HOST)
|
#if !defined(WOLFSSL_USE_POPEN_HOST)
|
||||||
#if (__GLIBC__ >= 2) && defined(__USE_MISC) && !defined(SINGLE_THREADED)
|
#if defined(__GLIBC__) && (__GLIBC__ >= 2) && defined(__USE_MISC) && \
|
||||||
|
!defined(SINGLE_THREADED)
|
||||||
HOSTENT entry_buf, *entry = NULL;
|
HOSTENT entry_buf, *entry = NULL;
|
||||||
char *ghbn_r_buf = NULL;
|
char *ghbn_r_buf = NULL;
|
||||||
int ghbn_r_errno;
|
int ghbn_r_errno;
|
||||||
@ -917,7 +918,8 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#if (__GLIBC__ >= 2) && defined(__USE_MISC) && !defined(SINGLE_THREADED)
|
#if defined(__GLIBC__) && (__GLIBC__ >= 2) && defined(__USE_MISC) && \
|
||||||
|
!defined(SINGLE_THREADED)
|
||||||
/* 2048 is a magic number that empirically works. the header and
|
/* 2048 is a magic number that empirically works. the header and
|
||||||
* documentation provide no guidance on appropriate buffer size other than
|
* documentation provide no guidance on appropriate buffer size other than
|
||||||
* "if buf is too small, the functions will return ERANGE, and the call
|
* "if buf is too small, the functions will return ERANGE, and the call
|
||||||
@ -938,7 +940,8 @@ int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip, word16 port, int to_sec)
|
|||||||
XMEMCPY(&sin->sin_addr.s_addr, entry->h_addr_list[0], entry->h_length);
|
XMEMCPY(&sin->sin_addr.s_addr, entry->h_addr_list[0], entry->h_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (__GLIBC__ >= 2) && defined(__USE_MISC) && !defined(SINGLE_THREADED)
|
#if defined(__GLIBC__) && (__GLIBC__ >= 2) && defined(__USE_MISC) && \
|
||||||
|
!defined(SINGLE_THREADED)
|
||||||
XFREE(ghbn_r_buf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
XFREE(ghbn_r_buf, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user