Fixed unsafe use of localtime
Since localtime is not thread-safe it should not be used in multithreaded contexts. For this reason all calls to localtime were changed to localtime_r in code where concurrency issues were possible. Internal tests were left unchanged because they aren't multithreaded.
This commit is contained in:

committed by
Markus Makela

parent
84d2c72db2
commit
6164b7f301
@ -161,7 +161,7 @@ int main(int argc, char* argv[])
|
||||
ss_dassert(succp);
|
||||
|
||||
t = time(NULL);
|
||||
tm = *(localtime(&t));
|
||||
localtime_r(&t, &tm);
|
||||
err = MXS_ERROR("%04d %02d/%02d %02d.%02d.%02d",
|
||||
tm.tm_year+1900,
|
||||
tm.tm_mon+1,
|
||||
|
Reference in New Issue
Block a user