This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin1.dll bug in ftime (patch included)


OK, here is the patch for src/winsup/cygwin/times.cc:

--------------------------------------------------------
--- times.cc.old        Tue Mar 26 11:36:53 2002
+++ times.cc    Tue Mar 26 11:53:42 2002
@@ -156,4 +156,5 @@
 {
   static hires gtod;
+  static tzflag;
   LONGLONG now = gtod.usecs (false);
   if (now == (LONGLONG) -1)
@@ -162,4 +163,15 @@
   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;
 }
--------------------------------------------------------

I did not submit a patch because I did not think you will accept it. Writing
the patch itself is easy: it was already there in an old CVS version. Or
almost so. Notice that I do not always call tzset. My previous experience
with MSVC indicates that calling tzset is costly. I am not sure of the case
with Cygwin. However, it is just there for you to review.

Best regards,

Wu Yongwei

--- Original Message from Christopher Faylor ---

On Tue, Mar 26, 2002 at 10:45:32AM +0800, Wu Yongwei wrote:
>Hope I am clear enough. I am arguing here for a BETTER Cygwin.

I guess I wasn't clear enough.

SUPPLY A PATCH TO FIX THE BEHAVIOR.

If you want me, or anyone else to fix it, you'll undoubtedly have a long
wait.  Especially since you have now polarized me by arguing points when
you could have been investigating the code and supplying a fix.

No arguments in the world work better than an actual patch.

cgf


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]