summaryrefslogtreecommitdiff
path: root/hooks.h
diff options
context:
space:
mode:
Diffstat (limited to 'hooks.h')
-rw-r--r--hooks.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/hooks.h b/hooks.h
index e1c131e..e860ddd 100644
--- a/hooks.h
+++ b/hooks.h
@@ -103,15 +103,10 @@ int
clock_gettime(clockid_t clk_id, struct timespec *tp)
{
HOOK(clock_gettime);
-
- if ((clk_id == CLOCK_MONOTONIC || clk_id == CLOCK_MONOTONIC_RAW)) {
- const uint64_t fake = get_fake_time_ns();
- tp->tv_sec = fake / (uint64_t)1e9;
- tp->tv_nsec = (fake % (uint64_t)1e9);
- return 0;
- }
-
- return _clock_gettime(clk_id, tp);
+ const uint64_t fake = get_fake_time_ns(clk_id);
+ tp->tv_sec = fake / (uint64_t)1e9;
+ tp->tv_nsec = (fake % (uint64_t)1e9);
+ return 0;
}
static void*