From 6a57ced16762ef92afe5c273a1a22a147f27d2bd Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 17 May 2016 12:05:10 -0400 Subject: [PATCH] Fix: unchecked return value in trace_clock_read64_monotonic Signed-off-by: Mathieu Desnoyers --- liblttng-ust/clock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/liblttng-ust/clock.h b/liblttng-ust/clock.h index 88eca432..0ea73e9d 100644 --- a/liblttng-ust/clock.h +++ b/liblttng-ust/clock.h @@ -41,7 +41,10 @@ uint64_t trace_clock_read64(void) { struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); + if (caa_unlikely(clock_gettime(CLOCK_MONOTONIC, &ts))) { + ts.tv_sec = 0; + ts.tv_nsec = 0; + } return ((uint64_t) ts.tv_sec * 1000000000ULL) + ts.tv_nsec; } -- 2.34.1