summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-06-20 15:55:39 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commitee528fbd5dc482ceece52832d4a8ea5a08251bfa (patch)
tree243ea4b34196fd7a36cb42d591aa55ba86c04484 /sysdep
parent92cc1e745758893a57a2432a0e11e4cd3ad289b7 (diff)
Timers: Add typecast to unit-converting macros
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 99f52aa9..25121d74 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -406,7 +406,7 @@ times_init(struct timeloop *loop)
if ((ts.tv_sec < 0) || (((s64) ts.tv_sec) > ((s64) 1 << 40)))
log(L_WARN "Monotonic clock is crazy");
- loop->last_time = ((s64) ts.tv_sec S) + (ts.tv_nsec / 1000);
+ loop->last_time = ts.tv_sec S + ts.tv_nsec NS;
loop->real_time = 0;
}
@@ -420,7 +420,7 @@ times_update(struct timeloop *loop)
if (rv < 0)
die("clock_gettime: %m");
- btime new_time = ((s64) ts.tv_sec S) + (ts.tv_nsec / 1000);
+ btime new_time = ts.tv_sec S + ts.tv_nsec NS;
if (new_time < loop->last_time)
log(L_ERR "Monotonic clock is broken");
@@ -439,7 +439,7 @@ times_update_real_time(struct timeloop *loop)
if (rv < 0)
die("clock_gettime: %m");
- loop->real_time = ((s64) ts.tv_sec S) + (ts.tv_nsec / 1000);
+ loop->real_time = ts.tv_sec S + ts.tv_nsec NS;
}
@@ -2281,7 +2281,7 @@ io_update_time(void)
if (rv < 0)
die("clock_gettime: %m");
- last_time = ((s64) ts.tv_sec S) + (ts.tv_nsec / 1000);
+ last_time = ts.tv_sec S + ts.tv_nsec NS;
if (event_open)
{