time-util: add and use USEC/NSEC_INFINIY

This commit is contained in:
Kay Sievers
2014-07-29 13:20:20 +02:00
parent cf347234ae
commit 3a43da2832
23 changed files with 79 additions and 76 deletions
+2 -2
View File
@@ -1142,7 +1142,7 @@ static usec_t calc_next_elapse(dual_timestamp *nw, dual_timestamp *next) {
assert(nw);
assert(next);
if (next->monotonic != (usec_t) -1 && next->monotonic > 0) {
if (next->monotonic != USEC_INFINITY && next->monotonic > 0) {
usec_t converted;
if (next->monotonic > nw->monotonic)
@@ -1150,7 +1150,7 @@ static usec_t calc_next_elapse(dual_timestamp *nw, dual_timestamp *next) {
else
converted = nw->realtime - (nw->monotonic - next->monotonic);
if (next->realtime != (usec_t) -1 && next->realtime > 0)
if (next->realtime != USEC_INFINITY && next->realtime > 0)
next_elapse = MIN(converted, next->realtime);
else
next_elapse = converted;