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.7.4~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8ac1661784a882d23b654360c0218ce984c478b9;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 388ed658..a7e8eb7b 100644 --- a/liblttng-ust/clock.h +++ b/liblttng-ust/clock.h @@ -50,7 +50,10 @@ uint64_t trace_clock_read64_monotonic(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; }