Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/times.cc')
-rw-r--r--winsup/cygwin/times.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index b7308bf02..1ad676453 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -155,12 +155,24 @@ extern "C" int
gettimeofday(struct timeval *tv, struct timezone *tz)
{
static hires gtod;
+ static tzflag;
LONGLONG now = gtod.usecs (false);
if (now == (LONGLONG) -1)
return -1;
tv->tv_sec = 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;
}