aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp/Discovery.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-18 16:26:11 +0100
committerMax Kellermann <max@duempel.org>2014-01-18 16:26:11 +0100
commit051eede1edda157f7354c9ad468e8884a8987979 (patch)
tree292b196b5cd09a3943542ec57d4aa240a4cc2fff /src/db/upnp/Discovery.cxx
parent0696cac50bfc9430e5094112dc5019be70998012 (diff)
downloadmpd-051eede1edda157f7354c9ad468e8884a8987979.tar.gz
mpd-051eede1edda157f7354c9ad468e8884a8987979.tar.xz
mpd-051eede1edda157f7354c9ad468e8884a8987979.zip
db/upnp/Discovery: use monotonic clock instead of time()
Diffstat (limited to '')
-rw-r--r--src/db/upnp/Discovery.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx
index 371f87244..f07751956 100644
--- a/src/db/upnp/Discovery.cxx
+++ b/src/db/upnp/Discovery.cxx
@@ -22,6 +22,7 @@
#include "Domain.hxx"
#include "ContentDirectoryService.hxx"
#include "upnpplib.hxx"
+#include "system/Clock.hxx"
#include "Log.hxx"
#include <upnp/upnptools.h>
@@ -74,7 +75,7 @@ UPnPDeviceDirectory::discoExplorer()
}
// Update or insert the device
- ContentDirectoryDescriptor d(time(0), tsk->expires);
+ ContentDirectoryDescriptor d(MonotonicClockS(), tsk->expires);
{
Error error2;
@@ -164,7 +165,7 @@ bool
UPnPDeviceDirectory::expireDevices(Error &error)
{
const ScopeLock protect(mutex);
- time_t now = time(0);
+ const unsigned now = MonotonicClockS();
bool didsomething = false;
for (auto it = directories.begin();
@@ -208,7 +209,7 @@ UPnPDeviceDirectory::Start(Error &error)
bool
UPnPDeviceDirectory::search(Error &error)
{
- time_t now = time(0);
+ const unsigned now = MonotonicClockS();
if (now - m_lastSearch < 10)
return true;
m_lastSearch = now;