Use _POLL_EMUL_H_ instead of HAVE_POLL_FINE
Headers define _POLL_EMUL_H_ if they are not in the kernel, so a try_run check for them is not necessary.
This commit is contained in:
parent
c5cbb318c5
commit
8d36890723
@ -193,14 +193,6 @@ SET(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
|||||||
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
|
CURL_CHECK_C_SOURCE_COMPILES("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
|
||||||
|
|
||||||
|
|
||||||
INCLUDE(CurlCheckCSourceRuns)
|
|
||||||
SET(EXTRA_DEFINES)
|
|
||||||
SET(HEADER_INCLUDES)
|
|
||||||
IF(HAVE_SYS_POLL_H)
|
|
||||||
SET(HEADER_INCLUDES "sys/poll.h")
|
|
||||||
ENDIF(HAVE_SYS_POLL_H)
|
|
||||||
CURL_CHECK_C_SOURCE_RUNS("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
|
|
||||||
|
|
||||||
SET(HAVE_SIG_ATOMIC_T 1)
|
SET(HAVE_SIG_ATOMIC_T 1)
|
||||||
SET(EXTRA_DEFINES)
|
SET(EXTRA_DEFINES)
|
||||||
SET(HEADER_INCLUDES)
|
SET(HEADER_INCLUDES)
|
||||||
|
@ -348,9 +348,6 @@
|
|||||||
/* Define to 1 if you have the `poll' function. */
|
/* Define to 1 if you have the `poll' function. */
|
||||||
#cmakedefine HAVE_POLL ${HAVE_POLL}
|
#cmakedefine HAVE_POLL ${HAVE_POLL}
|
||||||
|
|
||||||
/* If you have a fine poll */
|
|
||||||
#cmakedefine HAVE_POLL_FINE ${HAVE_POLL_FINE}
|
|
||||||
|
|
||||||
/* we have a POSIX-style strerror_r() */
|
/* we have a POSIX-style strerror_r() */
|
||||||
#cmakedefine HAVE_POSIX_STRERROR_R ${HAVE_POSIX_STRERROR_R}
|
#cmakedefine HAVE_POSIX_STRERROR_R ${HAVE_POSIX_STRERROR_R}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
*/
|
*/
|
||||||
int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_POLL_FINE) || defined(CURL_HAVE_WSAPOLL)
|
#if !defined(_POLL_EMUL_H_) || defined(CURL_HAVE_WSAPOLL)
|
||||||
struct pollfd pfd[2];
|
struct pollfd pfd[2];
|
||||||
int num;
|
int num;
|
||||||
int r;
|
int r;
|
||||||
@ -96,7 +96,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
|||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_POLL_FINE
|
#ifndef _POLL_EMUL_H_
|
||||||
do {
|
do {
|
||||||
r = poll(pfd, num, timeout_ms);
|
r = poll(pfd, num, timeout_ms);
|
||||||
} while((r == -1) && (errno == EINTR));
|
} while((r == -1) && (errno == EINTR));
|
||||||
@ -220,7 +220,7 @@ int Curl_select(curl_socket_t readfd, curl_socket_t writefd, int timeout_ms)
|
|||||||
int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
|
int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
#ifdef HAVE_POLL_FINE
|
#ifndef _POLL_EMUL_H_
|
||||||
do {
|
do {
|
||||||
r = poll(ufds, nfds, timeout_ms);
|
r = poll(ufds, nfds, timeout_ms);
|
||||||
} while((r == -1) && (errno == EINTR));
|
} while((r == -1) && (errno == EINTR));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user