change time_monotonic_ms() from time_t to int64_t

time_monotonic_ms values did wrap every ~24 days, leading to problems
in code that did not cope with that. Instead of fixing all places where
relative comparisons with time_monotonic_ms() are made, just use a
bigger datatype. Convert all users to the new type.
This commit is contained in:
Stefan Seyfried
2017-09-23 21:35:01 +02:00
committed by Jacek Jendrzej
parent c7f429019d
commit 8dad062eff
11 changed files with 40 additions and 36 deletions

View File

@@ -2119,10 +2119,10 @@ void CNeutrinoApp::InitSectiondClient()
#if 0
/* TODO: check if still needed */
/* wait for sectionsd to be able to process our registration */
time_t t = time_monotonic_ms();
int64_t t = time_monotonic_ms();
while (! sectionsd_isReady())
sleep(0);
dprintf(DEBUG_NORMAL, "had to wait %ld ms for sectionsd to start up\n", time_monotonic_ms() - t);
dprintf(DEBUG_NORMAL, "had to wait %" PRId64 " ms for sectionsd to start up\n", time_monotonic_ms() - t);
#endif
g_Sectionsd = new CSectionsdClient;
struct timespec t;
@@ -2376,10 +2376,10 @@ TIMER_START();
InitSectiondClient();
/* wait until timerd is ready... */
time_t timerd_wait = time_monotonic_ms();
int64_t timerd_wait = time_monotonic_ms();
while (timerd_signal >= 0)
usleep(100);
dprintf(DEBUG_NORMAL, "had to wait %ld ms for timerd start...\n", time_monotonic_ms() - timerd_wait);
dprintf(DEBUG_NORMAL, "had to wait %" PRId64 " ms for timerd start...\n", time_monotonic_ms() - timerd_wait);
InitTimerdClient();
// volume