* times.cc (gettimeofday): Revert to setting timezone info if tz != NULL.
This commit is contained in:
parent
c82479b1e3
commit
7d7524e57d
@ -1,3 +1,8 @@
|
|||||||
|
2002-03-27 Wu Yongwei <adah@netstd.com>
|
||||||
|
|
||||||
|
* times.cc (gettimeofday): Revert to setting timezone info if tz !=
|
||||||
|
NULL.
|
||||||
|
|
||||||
2002-03-21 Christopher Faylor <cgf@redhat.com>
|
2002-03-21 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
|
* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Always set
|
||||||
|
@ -155,12 +155,24 @@ extern "C" int
|
|||||||
gettimeofday(struct timeval *tv, struct timezone *tz)
|
gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||||
{
|
{
|
||||||
static hires gtod;
|
static hires gtod;
|
||||||
|
static tzflag;
|
||||||
LONGLONG now = gtod.usecs (false);
|
LONGLONG now = gtod.usecs (false);
|
||||||
if (now == (LONGLONG) -1)
|
if (now == (LONGLONG) -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
tv->tv_sec = now / 1000000;
|
tv->tv_sec = now / 1000000;
|
||||||
tv->tv_usec = 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user