delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/30/20:23:17

From: newsham AT aloha DOT net (Tim Newsham)
Subject: gettimeofday()
30 Jul 1997 20:23:17 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199707310247.QAA17076.cygnus.gnu-win32@haleakala.aloha.net>
Mime-Version: 1.0
Original-To: gnu-win32 AT cygnus DOT com
X-Mailer: ELM [version 2.4 PL24 PGP3 *ALPHA*]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019