* vmsdbgout.c (lookup_filename): Adjust creation date for GMT.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Mar 2002 13:22:57 +0000 (13:22 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Mar 2002 13:22:57 +0000 (13:22 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50582 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/vmsdbgout.c

index 080b410..0b88f64 100644 (file)
@@ -1,5 +1,7 @@
 2002-03-11  Douglas B Rupp  <rupp@gnat.com>
 
+       * vmsdbgout.c (lookup_filename): Adjust creation date for GMT.
+
        * config/alpha/xm-vms.h (__UNIX_FWRITE): Define.
 
        * config/alpha/alpha.c (alpha_sa_size, VMS): Don't reserve space
index 15318ed..245875c 100644 (file)
@@ -1455,15 +1455,26 @@ lookup_filename (file_name)
 
   if (stat (file_name, &statbuf) == 0)
     {
-      cdt = 10000000 * (statbuf.st_ctime + vms_epoch_offset);
-      ebk = statbuf.st_size / 512 + 1;
-      ffb = statbuf.st_size - ((statbuf.st_size / 512) * 512);
+      long gmtoff;
 #ifdef VMS
+      struct tm *ts;
+
+      /* Adjust for GMT */
+      ts = (struct tm *) localtime (&statbuf.st_ctime);
+      gmtoff = ts->tm_gmtoff;
+
+      /* VMS has multiple file format types */
       rfo = statbuf.st_fab_rfm;
 #else
+      /* Is GMT adjustment an issue with a cross-compiler? */
+      gmtoff = 0;
+
       /* Assume stream LF type file */
       rfo = 2;
 #endif
+      cdt = 10000000 * (statbuf.st_ctime + gmtoff + vms_epoch_offset);
+      ebk = statbuf.st_size / 512 + 1;
+      ffb = statbuf.st_size - ((statbuf.st_size / 512) * 512);
       fnam = full_name (file_name);
       flen = strlen (fnam);
     }