const char *name;
struct timeval tv;
struct tm *tm=NULL;
+ struct tm result;
if (!h)
return;
{
/* get local time from tv */
gettimeofday(&tv, NULL);
- tm = localtime(&tv.tv_sec);
+ tm = localtime_r(&tv.tv_sec, &result);
/* write to file */
if (tm)
if( tm == NULL )
{
gettimeofday(&tv, NULL);
- tm = localtime(&tv.tv_sec);
+ tm = localtime_r(&tv.tv_sec, &result);
}
tv_ms = tv.tv_usec/1000;