X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Fclock.h;h=a7e8eb7b49e062b1e5ebe9f24cd7d60278a4c64e;hb=0e5be01a1d6dead78567428f158d14fc61fbba5f;hp=388ed658cbb9761a3c206c890ed620a396d3f92b;hpb=494da6a46a3246d0cb77191ba06ae060d27e5571;p=lttng-ust.git 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; }