|
From: | Lars Kindermann |
Subject: | [Octave-bug-tracker] [bug #53539] GUI file browser date stamps / editor script file appear modified when parsing date strings |
Date: | Fri, 20 Apr 2018 14:30:55 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0 |
Follow-up Comment #10, bug #53539 (project octave): I think the culprit that really has to be avoided is setenv ("TZ", "UTC0") because *"Modifications of environment variables are not allowed in multi-threaded programs"*. In glibc the setenv() function is MT-unsafe. See https://www.gnu.org/software/libc/manual/html_node/Environment-Access.html#Environment-Access But I'm aware why Mike has introduced the temporary switch to UTC timezone. strptime() is otherwise almost unusable. It is even recommended to do so in several articles on using time related functions. But serious problems arise in multi-threaded programs. Imagine what happens if several threads tamper uncoordinated with the TZ variable... Maybe the only 100% safe and correct way is to write an own replacement of strptime, which does not care about timezones and daylight saving at all. Perhaps the code from glibc can be stripped down to the bare minimum. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?53539> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |