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:40 +0000 (12:05 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/clock.h

index 88eca432a5733f7e4bc35f1878b911617a5119d5..0ea73e9d43ee9658bcc9d4d1c39cf2206477f31e 100644 (file)
@@ -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;
 }
 
This page took 0.024742 seconds and 4 git commands to generate.