From: Remi Gacogne Date: Fri, 26 Nov 2021 13:48:16 +0000 (+0100) Subject: dnsdist: Use `time()` instead of `gettimeofday()`, as suggested by Otto X-Git-Tag: rec-4.7.0-alpha0~12^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11037%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Use `time()` instead of `gettimeofday()`, as suggested by Otto --- diff --git a/pdns/dnsdistdist/dnsdist-healthchecks.cc b/pdns/dnsdistdist/dnsdist-healthchecks.cc index c689877d66..50b9341ccc 100644 --- a/pdns/dnsdistdist/dnsdist-healthchecks.cc +++ b/pdns/dnsdistdist/dnsdist-healthchecks.cc @@ -292,9 +292,7 @@ static void healthCheckTCPCallback(int fd, FDMultiplexer::funcparam_t& param) try { auto sessions = data->d_tcpHandler->getTLSSessions(); if (!sessions.empty()) { - struct timeval now; - gettimeofday(&now, nullptr); - g_sessionCache.putSessions(data->d_ds->getID(), now.tv_sec, std::move(sessions)); + g_sessionCache.putSessions(data->d_ds->getID(), time(nullptr), std::move(sessions)); } } catch (const std::exception& e) {