#include "eval.h"
#include "log.h"
#include "random_seed.h"
+#include "time_internal.h"
#include "parseutils.h"
#ifdef TEST
const char *p, *q;
int64_t t;
time_t now;
- struct tm dt = { 0 };
+ struct tm dt = { 0 }, tmbuf;
int today = 0, negative = 0, microseconds = 0;
int i;
static const char * const date_fmt[] = {
int is_utc = *q == 'Z' || *q == 'z';
q += is_utc;
if (today) { /* fill in today's date */
- struct tm dt2 = is_utc ? *gmtime(&now) : *localtime(&now);
+ struct tm dt2 = is_utc ? *gmtime_r(&now, &tmbuf) : *localtime_r(&now, &tmbuf);
dt2.tm_hour = dt.tm_hour;
dt2.tm_min = dt.tm_min;
dt2.tm_sec = dt.tm_sec;