Page MenuHomeFreeBSD

D52240.id161195.diff
No OneTemporary

D52240.id161195.diff

diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c
--- a/contrib/tzcode/localtime.c
+++ b/contrib/tzcode/localtime.c
@@ -1624,14 +1624,14 @@
static void
tzset_unlocked(void)
{
+ char const *name = getenv("TZ");
#ifdef __FreeBSD__
- tzset_unlocked_name(getenv("TZ"));
+ tzset_unlocked_name(name);
}
static void
tzset_unlocked_name(char const *name)
{
-#else
- char const *name = getenv("TZ");
+ int tzloadflags = TZLOAD_TZSTRING | (name ? TZLOAD_FROMENV : 0);
#endif
struct state *sp = lclptr;
int lcl = name ? strlen(name) < sizeof lcl_TZname : -1;
@@ -1647,7 +1647,11 @@
lclptr = sp = malloc(sizeof *lclptr);
# endif
if (sp) {
+#ifdef __FreeBSD__
+ if (zoneinit(sp, name, tzloadflags) != 0) {
+#else
if (zoneinit(sp, name, TZLOAD_FROMENV | TZLOAD_TZSTRING) != 0) {
+#endif
zoneinit(sp, "", 0);
strcpy(sp->chars, UNSPEC);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jun 14, 5:53 PM (10 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33957037
Default Alt Text
D52240.id161195.diff (899 B)

Event Timeline