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
@ -530,7 +530,8 @@ module_feedback_send(void* data) {
|
||||
int http_send = 0;
|
||||
|
||||
now = time(NULL);
|
||||
now_tm = localtime(&now);
|
||||
struct tm now_result;
|
||||
now_tm = localtime_r(&now, &now_result);
|
||||
hour = now_tm->tm_hour;
|
||||
|
||||
FEEDBACK_CONF *feedback_config = (FEEDBACK_CONF *) data;
|
||||
|
||||
Reference in New Issue
Block a user