]> sjero.net Git - wget/commitdiff
[svn] Don't sleep using usleep for more than a second.
authorhniksic <devnull@localhost>
Sun, 25 Jan 2004 03:16:33 +0000 (19:16 -0800)
committerhniksic <devnull@localhost>
Sun, 25 Jan 2004 03:16:33 +0000 (19:16 -0800)
src/ChangeLog
src/utils.c

index 4cd4fa33eaf0ffe2b06ed5eb404840330e4404dd..0582437647f9c0d2c37a163a91ac94bf60e144e4 100644 (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>
 
        * http.c (gethttp): Fix generation of `Content-Length'.
index c83e4499f5e8c6f432a4a36462208c67e369e74e..c9de2ea2480b6c8f96c83cb5e8df8077ae8c6462 100644 (file)
@@ -1954,11 +1954,10 @@ xsleep (double seconds)
 #else  /* not HAVE_NANOSLEEP */
 #ifdef HAVE_USLEEP
   /* 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
-        sleep longer than ~70 min (35min if signed).  If the period
-        is larger than what usleep can safely handle, use sleep
+      /* On some systems, usleep cannot handle values larger than
+        1,000,000.  If the period is larger than that, use sleep
         first, then add usleep for subsecond accuracy.  */
       sleep (seconds);
       seconds -= (long) seconds;