mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
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:
@@ -423,8 +423,9 @@ std::string getNowTimeStr(const char* format)
|
|||||||
{
|
{
|
||||||
char tmpStr[256];
|
char tmpStr[256];
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
struct tm t;
|
||||||
gettimeofday(&tv, NULL);
|
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;
|
return (std::string)tmpStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user