X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Fclock.h;fp=liblttng-ust%2Fclock.h;h=a7e8eb7b49e062b1e5ebe9f24cd7d60278a4c64e;hb=776860373a25f9dcbe68e2690a34d7c641e7ef00;hp=388ed658cbb9761a3c206c890ed620a396d3f92b;hpb=22389ecb8b7867bc1d21b1e11ba7572be8eca81f;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; }