From: Mathieu Desnoyers Date: Tue, 17 May 2016 16:05:10 +0000 (-0400) Subject: Fix: unchecked return value in trace_clock_read64_monotonic X-Git-Tag: v2.6.7~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6a57ced16762ef92afe5c273a1a22a147f27d2bd;p=lttng-ust.git Fix: unchecked return value in trace_clock_read64_monotonic Signed-off-by: Mathieu Desnoyers --- 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; }