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
path: root/newlib
diff options
context:
space:
mode:
authorCraig Howland <howland@LGSInnovations.com>2015-03-31 11:26:49 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-04-23 22:57:08 +0300
commit382fa90fe1fdd0f363088a28a5be12a4548099b4 (patch)
treee219fff8cf373366c9c909ac557b2c9fd10236c8 /newlib
parent95a4fc87264e5fdeb5452d63d3b2df217a2f19b2 (diff)
Move tzset calls to time functions.
* libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ definition. * libc/time/lcltime_r.c (localtime_r): Add tzset() call * libc/time/mktime.c (mktime): Ditto. * libc/time/strftime.c (strftime, wcsftime): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog8
-rw-r--r--newlib/libc/stdlib/setenv_r.c7
-rw-r--r--newlib/libc/time/lcltime_r.c1
-rw-r--r--newlib/libc/time/mktime.c2
-rw-r--r--newlib/libc/time/strftime.c2
5 files changed, 13 insertions, 7 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 6e45e940b..c214b6988 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,11 @@
+2015-03-30 Craig Howland <howland@LGSInnovations.com>
+
+ * libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ
+ definition.
+ * libc/time/lcltime_r.c (localtime_r): Add tzset() call
+ * libc/time/mktime.c (mktime): Ditto.
+ * libc/time/strftime.c (strftime, wcsftime): Ditto.
+
2015-03-30 Yaakov Selkowitz <yselkowi@redhat.com>
* libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL.
diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c
index f9ff2c1cd..c32c6aca9 100644
--- a/newlib/libc/stdlib/setenv_r.c
+++ b/newlib/libc/stdlib/setenv_r.c
@@ -79,9 +79,6 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite),
{ /* old larger; copy over */
while ((*C++ = *value++) != 0);
ENV_UNLOCK;
- /* if we are changing the TZ environment variable, update timezone info */
- if (strcmp (name, "TZ") == 0)
- tzset ();
return 0;
}
}
@@ -128,10 +125,6 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite),
ENV_UNLOCK;
- /* if we are setting the TZ environment variable, update timezone info */
- if (strncmp ((*p_environ)[offset], "TZ=", 3) == 0)
- tzset ();
-
return 0;
}
diff --git a/newlib/libc/time/lcltime_r.c b/newlib/libc/time/lcltime_r.c
index 9094e5d3a..8a69e40ee 100644
--- a/newlib/libc/time/lcltime_r.c
+++ b/newlib/libc/time/lcltime_r.c
@@ -31,6 +31,7 @@ _DEFUN (localtime_r, (tim_p, res),
year = res->tm_year + YEAR_BASE;
ip = __month_lengths[isleap(year)];
+ tzset ();
TZ_LOCK;
if (_daylight)
{
diff --git a/newlib/libc/time/mktime.c b/newlib/libc/time/mktime.c
index 5bedf5afc..8669fbdfb 100644
--- a/newlib/libc/time/mktime.c
+++ b/newlib/libc/time/mktime.c
@@ -197,6 +197,8 @@ _DEFUN(mktime, (tim_p),
/* compute total seconds */
tim += (days * _SEC_IN_DAY);
+ tzset ();
+
TZ_LOCK;
if (_daylight)
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
index ee604c2e4..72f06d32e 100644
--- a/newlib/libc/time/strftime.c
+++ b/newlib/libc/time/strftime.c
@@ -1283,6 +1283,7 @@ recurse:
if (tim_p->tm_isdst >= 0)
{
long offset;
+ tzset ();
#if defined (__CYGWIN__)
/* Cygwin must check if the application has been built with or
@@ -1313,6 +1314,7 @@ recurse:
size_t size;
const char *tznam = NULL;
+ tzset ();
TZ_LOCK;
#if defined (__CYGWIN__)
/* See above. */