static void *StatsWakeupThread(void *arg)
{
ThreadVars *tv_local = (ThreadVars *)arg;
- struct timespec cond_time;
/* Set the thread name */
if (SCSetThreadName(tv_local->name) < 0) {
TmThreadsUnsetFlag(tv_local, THV_PAUSED);
}
- cond_time.tv_sec = time(NULL) + STATS_WUT_TTS;
- cond_time.tv_nsec = 0;
+ struct timeval cur_timev;
+ gettimeofday(&cur_timev, NULL);
+ struct timespec cond_time = FROM_TIMEVAL(cur_timev);
+ cond_time.tv_sec += STATS_WUT_TTS;
/* wait for the set time, or until we are woken up by
* the shutdown procedure */