]> sourceware.org Git - newlib-cygwin.git/commitdiff
* times.cc (gettimeofday): Revert to setting timezone info if tz != NULL.
authorChristopher Faylor <me@cgf.cx>
Thu, 28 Mar 2002 04:56:06 +0000 (04:56 +0000)
committerChristopher Faylor <me@cgf.cx>
Thu, 28 Mar 2002 04:56:06 +0000 (04:56 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/times.cc

index d880a71abcb013cff82101b5753589d1ac3c9c37..9d5bc78414111ade9662b202435dd94a7e839a07 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-27  Wu Yongwei  <adah@netstd.com>
+
+       * times.cc (gettimeofday): Revert to setting timezone info if tz !=
+       NULL.
+
 2002-03-21  Christopher Faylor  <cgf@redhat.com>
 
        * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
index b7308bf0200eb63c59c2d47b2d77ce2ccd7d726d..1ad6764536040e727a4f6bfca532fd85919eb17b 100644 (file)
@@ -155,12 +155,24 @@ extern "C" int
 gettimeofday(struct timeval *tv, struct timezone *tz)
 {
   static hires gtod;
+  static tzflag;
   LONGLONG now = gtod.usecs (false);
   if (now == (LONGLONG) -1)
     return -1;
 
   tv->tv_sec = now / 1000000;
   tv->tv_usec = now % 1000000;
+
+  if (tz != NULL)
+    {
+      if (!tzflag) {
+        tzset();
+        tzflag = 1;
+      }
+      tz->tz_minuteswest = _timezone / 60;
+      tz->tz_dsttime = _daylight;
+    }
+
   return 0;
 }
 
This page took 0.034915 seconds and 5 git commands to generate.