FW: timezone code - re-entrancy issue

Robert Elz kre at munnari.OZ.AU
Mon Jan 12 22:04:39 UTC 2009


    Date:        Mon, 12 Jan 2009 13:09:52 -0500
    From:        "Olson, Arthur David (NIH/NCI) [E]" <olsona at dc37a.nci.nih.gov>
    Message-ID:  <B410D30A78C6404C9DABEA31B54A2813029A0408 at nihcesmlbx10.nih.gov>

  | At the bottom of localsub, 
  | 
  | 	tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
  | 
  | I think this is to update the tzname string to the last time zone abbr.
  | actually used in to produce the tm values.
  | 
  | It is not re-entrant.

We know.   The tzname[] array is a bogus legacy interface that has to
be maintained for compatability with ancient applications.   Nothing rational
is going to be using it these days.   Just ignore that nonsense - if your
application has no need for this legacy compatability, just delete
tzname[] completely.

kre

ps: in most timezones, even though those assignments happen relatively
frequently in theory, in practice, they're asigning what are essentially
constants (for the zone) so the values mostly don't ever actually change.
This isn't guaranteed of course, but even if a threaded application
were written badly enough that it was using global variables like this
in most cases, no-one would ever notice the problems.




More information about the tz mailing list