1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Don't sleep using usleep for more than a second.

This commit is contained in:
hniksic 2004-01-24 19:16:33 -08:00
parent 6be0e99a5e
commit dc99d9a487
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-01-25 Hrvoje Niksic <hniksic@xemacs.org>
* utils.c (xsleep): Don't call usleep with values larger than
1,000,000.
2003-12-16 Hrvoje Niksic <hniksic@xemacs.org> 2003-12-16 Hrvoje Niksic <hniksic@xemacs.org>
* http.c (gethttp): Fix generation of `Content-Length'. * http.c (gethttp): Fix generation of `Content-Length'.

View File

@ -1954,11 +1954,10 @@ xsleep (double seconds)
#else /* not HAVE_NANOSLEEP */ #else /* not HAVE_NANOSLEEP */
#ifdef HAVE_USLEEP #ifdef HAVE_USLEEP
/* If usleep is available, use it in preference to select. */ /* If usleep is available, use it in preference to select. */
if (seconds > 1000) if (seconds >= 1)
{ {
/* usleep apparently accepts unsigned long, which means it can't /* On some systems, usleep cannot handle values larger than
sleep longer than ~70 min (35min if signed). If the period 1,000,000. If the period is larger than that, use sleep
is larger than what usleep can safely handle, use sleep
first, then add usleep for subsecond accuracy. */ first, then add usleep for subsecond accuracy. */
sleep (seconds); sleep (seconds);
seconds -= (long) seconds; seconds -= (long) seconds;