mirror of
https://github.com/curl/curl.git
synced 2026-07-30 22:58:03 +03:00
check for a fine poll() before it is used to sleep subsecond
This commit is contained in:
parent
6f252f4704
commit
a7b99fc463
4 changed files with 45 additions and 2 deletions
|
|
@ -35,6 +35,9 @@
|
|||
/* Define if you have the `poll' function. */
|
||||
#undef HAVE_POLL
|
||||
|
||||
/* Define if you have a good `poll' function that can wait on NULL. */
|
||||
#undef HAVE_POLL_FINE
|
||||
|
||||
/* Define if you can write to argc[] strings */
|
||||
#undef HAVE_WRITABLE_ARGV
|
||||
|
||||
|
|
|
|||
|
|
@ -2243,7 +2243,7 @@ static void parseconfig(const char *filename,
|
|||
|
||||
static void go_sleep(long ms)
|
||||
{
|
||||
#ifdef HAVE_POLL
|
||||
#ifdef HAVE_POLL_FINE
|
||||
/* portable subsecond "sleep" */
|
||||
poll((void *)0, 0, ms);
|
||||
#else
|
||||
|
|
@ -2259,7 +2259,7 @@ static void go_sleep(long ms)
|
|||
struct timeval timeout;
|
||||
|
||||
timeout.tv_sec = ms/1000;
|
||||
ms -= ms/1000;
|
||||
ms = ms%1000;
|
||||
timeout.tv_usec = ms * 1000;
|
||||
|
||||
select(0, NULL, NULL, NULL, &timeout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue