This patch seems to fix the issue with the time change in CVS on NT.
Currently, every file is considered changed and sent up to the server for
comparison.  This is only noticeable by the time required and certain binary
files which, due to a different bug, are read as ascii and considered to be
of a different size.

Thanks
chuck & mark
[EMAIL PROTECTED]
[EMAIL PROTECTED]




diff -r -u orig/cvs-1.10.8/lib/system.h cvs-1.10.8/lib/system.h
--- orig/cvs-1.10.8/lib/system.h        Mon Feb 16 13:55:18 1998
+++ cvs-1.10.8/lib/system.h     Sun Apr 02 17:52:48 2000
@@ -460,6 +460,10 @@
 #define CVS_LSTAT lstat
 #endif
 
+#ifndef CVS_GMTIME
+#define CVS_GMTIME gmtime
+#endif
+
 #ifndef CVS_UNLINK
 #define CVS_UNLINK unlink
 #endif
diff -r -u orig/cvs-1.10.8/src/vers_ts.c cvs-1.10.8/src/vers_ts.c
--- orig/cvs-1.10.8/src/vers_ts.c       Sat Oct 03 21:01:40 1998
+++ cvs-1.10.8/src/vers_ts.c    Sun Apr 02 17:51:38 2000
@@ -315,7 +315,7 @@
           systems where gmtime returns NULL, the modification time is
           stored in local time, and therefore it is not possible to cause
           st_mtime to be out of sync by changing the timezone.  */
-       tm_p = gmtime (&sb.st_mtime);
+       tm_p = CVS_GMTIME (&sb.st_mtime);
        if (tm_p)
        {
            memcpy (&local_tm, tm_p, sizeof (local_tm));
@@ -358,7 +358,7 @@
           systems where gmtime returns NULL, the modification time is
           stored in local time, and therefore it is not possible to cause
           st_mtime to be out of sync by changing the timezone.  */
-       tm_p = gmtime (&sb.st_mtime);
+       tm_p = CVS_GMTIME (&sb.st_mtime);
        if (tm_p)
        {
            memcpy (&local_tm, tm_p, sizeof (local_tm));
diff -r -u orig/cvs-1.10.8/windows-NT/config.h
cvs-1.10.8/windows-NT/config.h
--- orig/cvs-1.10.8/windows-NT/config.h Thu Oct 01 12:49:10 1998
+++ cvs-1.10.8/windows-NT/config.h      Sun Apr 02 17:50:37 2000
@@ -239,6 +239,8 @@
 extern int wnt_stat ();
 #define CVS_LSTAT wnt_lstat
 extern int wnt_lstat ();
+#define CVS_GMTIME wnt_gmtime
+extern struct tm *wnt_gmtime (long *inTime);
 
 #define CVS_RENAME wnt_rename
 extern int wnt_rename (const char *, const char *);
diff -r -u orig/cvs-1.10.8/windows-NT/filesubr.c
cvs-1.10.8/windows-NT/filesubr.c
--- orig/cvs-1.10.8/windows-NT/filesubr.c       Wed Sep 30 16:38:29 1998
+++ cvs-1.10.8/windows-NT/filesubr.c    Sun Apr 02 18:01:39 2000
@@ -937,3 +937,22 @@
     check_statbuf (file, sb);
     return retval;
 }
+
+/*  This glorious hack seems to be necessary because 
+    gmtime does not return the correct result during DST.
+    When this occurs, every file is transmitted for comparison.
+    Due to another bug, some binary files would appear changed.
+*/
+
+struct tm *
+wnt_gmtime (long *inTime)
+{
+    long gtime;
+    TIME_ZONE_INFORMATION TimeZoneInformation;
+    DWORD dst;
+
+    dst = GetTimeZoneInformation(&TimeZoneInformation);
+    gtime = *inTime - (dst==TIME_ZONE_ID_DAYLIGHT ? 3600 : 0);
+    
+    return (gmtime(&gtime));
+}

Reply via email to