Subject: Re: Beta 18 breaks gettimeofday
From: [email-masked] (Geoffrey Noer)

27 May 1997 17:43:24 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (Jonathan Wilkins)
Original-Cc: [email-masked]
In-Reply-To: <[email-masked]> from "Jonathan Wilkins" at May 26, 97 12:26:03 pm
X-Mailer: ELM [version 2.4 PL23]
Original-Sender: [email-masked]

Jonathan Wilkins wrote:
> 
> in regards to this problem.. it was simply a problem with the returned
> result from gettimeofday().. all other *NIX's seem to return 0 on success,
> and the cygwin returns non-0 on success.. perhaps this should be changed..

Thanks.  The code now reads instead of always returning 1:

int
gettimeofday (struct timeval *p, struct timezone *z)
{
  /* FIXME: should return zero on success, -1 on failure */
  SYSTEMTIME t;
  FILETIME f;
  TIME_ZONE_INFORMATION tz;

  GetTimeZoneInformation (&tz);

  GetSystemTime (&t);
  /* FIXME: ignores tz */
  SystemTimeToFileTime (&t, &f);

  if (p)
    {
      totimeval (p, &f, tz.Bias * 60);
    }
  if (z)
    {
      z->tz_minuteswest = tz.Bias;
      z->tz_dsttime = tz.StandardBias != tz.Bias;
    }
  return 0;
}

More return code setting/checking needs to be added to this
and other functions in winsup/times.cc (and other files in winsup).
Hopefully returning zero will be a bit better than what was
there previously though...

-- 
Geoffrey Noer
[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".