Mail Archives: cygwin/1997/05/27/17:43:24
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
noer AT cygnus DOT com
-
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 -