Fix: unchecked return value in trace_clock_read64_monotonic
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2016 16:05:10 +0000 (12:05 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2016 16:05:36 +0000 (12:05 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/clock.h

index 388ed658cbb9761a3c206c890ed620a396d3f92b..a7e8eb7b49e062b1e5ebe9f24cd7d60278a4c64e 100644 (file)
@@ -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;
 }
 
This page took 0.024924 seconds and 4 git commands to generate.