pango: Call tzset() before localtime_r()

POSIX and your local friendly ctime(3) manual entry says that localtime_r isn't
required to set the state variables that define the current timezone.  Indeed,
glibc (at least 2.9) doesn't do this for subsequent calls.  The effect is that
if the system timezone is changed for a running program between two calls to
gst_clock_overlay_render_time, it won't be noticed.  For glibc, changing the
timezone equals /etc/localtime being modified.

Fixes bug #587676.
This commit is contained in:
Hans-Peter Nilsson 2009-07-05 18:01:38 +02:00 committed by Sebastian Dröge
parent 8937c89551
commit 04e23f2d6a

View file

@ -97,6 +97,9 @@ gst_clock_overlay_render_time (GstClockOverlay * overlay)
now = time (NULL); now = time (NULL);
#ifdef HAVE_LOCALTIME_R #ifdef HAVE_LOCALTIME_R
/* Need to call tzset explicitly when calling localtime_r for changes
to the timezone between calls to be visible. */
tzset ();
t = localtime_r (&now, &dummy); t = localtime_r (&now, &dummy);
#else #else
/* on win32 this apparently returns a per-thread struct which would be fine */ /* on win32 this apparently returns a per-thread struct which would be fine */