system/helpers.cpp: getNowTimeStr(), use thread save localtime version

Origin commit data
------------------
Branch: ni/coolstream
Commit: 3538077821
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-01-14 (Wed, 14 Jan 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2015-01-14 20:20:11 +01:00
parent 97add2603e
commit 1cc532eea3

View File

@@ -423,8 +423,9 @@ std::string getNowTimeStr(const char* format)
{
char tmpStr[256];
struct timeval tv;
struct tm t;
gettimeofday(&tv, NULL);
strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec));
strftime(tmpStr, sizeof(tmpStr), format, localtime_r(&tv.tv_sec, &t));
return (std::string)tmpStr;
}