cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog subr.c [cvs1-11-x-branch]


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog subr.c [cvs1-11-x-branch]
Date: Sun, 19 Jul 2009 04:03:22 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         cvs1-11-x-branch
Changes by:     Derek Robert Price <dprice>     09/07/19 04:03:21

Modified files:
        src            : ChangeLog subr.c 

Log message:
        * subr.c (sleep_past): Don't assume that time() called after
        gettimeofday() must return a seconds value >= than gettimeofday() did.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.2336.2.514&r2=1.2336.2.515
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.c?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.72.4.33&r2=1.72.4.34

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.2336.2.514
retrieving revision 1.2336.2.515
diff -u -b -r1.2336.2.514 -r1.2336.2.515
--- ChangeLog   19 Nov 2008 21:47:58 -0000      1.2336.2.514
+++ ChangeLog   19 Jul 2009 04:03:20 -0000      1.2336.2.515
@@ -1,3 +1,8 @@
+2009-07-18  Derek R. Price  <address@hidden>
+
+       * subr.c (sleep_past): Don't assume that time() called after
+       gettimeofday() must return a seconds value >= than gettimeofday() did.
+
 2008-11-19  Larry Jones  <address@hidden>
 
        * entries.c (WriteTag): Remove any exiting file and recreate

Index: subr.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.c,v
retrieving revision 1.72.4.33
retrieving revision 1.72.4.34
diff -u -b -r1.72.4.33 -r1.72.4.34
--- subr.c      7 May 2008 15:34:17 -0000       1.72.4.33
+++ subr.c      19 Jul 2009 04:03:21 -0000      1.72.4.34
@@ -911,8 +911,7 @@
 #ifdef HAVE_GETTIMEOFDAY
        struct timeval tv;
        gettimeofday (&tv, NULL);
-       if (tv.tv_sec > desttime)
-           break;
+       if (tv.tv_sec <= desttime) {
        s = desttime - tv.tv_sec;
        if (tv.tv_usec > 0)
            us = 1000000 - tv.tv_usec;
@@ -921,11 +920,21 @@
            s++;
            us = 0;
        }
-#else
+       }
+       else
+#endif
+       {
+           /* On at least one Linux 2.6.24 system, time() lags behind
+            * gettimeofday() by up to 10 msec, and file time stamps use
+            * time().  For example, time() might return 1247677670 while
+            * gettimeofday() returns 1247677671.000060, so we always sleep
+            * at least 20ms and retry the test using time(), like we do when
+            * gettimeofday() is not available.
+            */
        /* default to 20 ms increments */
-       s = (long)(desttime - t);
        us = 20000;
-#endif
+           s = (long)(desttime - t);
+       }
 
 #if defined(HAVE_NANOSLEEP)
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]