This is the mail archive of the cygwin@sourceware.cygnus.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]

gettimeofday()



Hi,

   I came across a bug in gettimeofday() today.  Under
some conditions the call can incorrectly return -1
even when it performs the correct operation.  

For example, if your timezone is set to "(GMT-10:00)Hawaii"
then the function will return -1.

A patch for this problem is:

*** times.cc.orig       Tue Jul 29 23:22:31 1997
--- times.cc    Wed Jul 30 15:51:27 1997
***************
*** 103,110 ****
    TIME_ZONE_INFORMATION tz;

    tzid = GetTimeZoneInformation (&tz);
!   if (tzid == TIME_ZONE_ID_UNKNOWN)
      ret = -1;

    if (p != NULL)
      {
--- 103,112 ----
    TIME_ZONE_INFORMATION tz;

    tzid = GetTimeZoneInformation (&tz);
!   if (tzid == 0xffffffff) {
!     debug_printf ("gettimeofday: unknown timezone id\n");
      ret = -1;
+   }

    if (p != NULL)
      {
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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