Fix: unchecked return value in trace_clock_read64_monotonic
[lttng-tools.git] / src / bin / lttng-sessiond / ust-clock.h
index 8493737634a72d8656e6ddb155aa68d6452c33ea..c2e0cbcc394a9708f16801802761169e8cd0ea6d 100644 (file)
@@ -57,7 +57,12 @@ uint64_t trace_clock_read64_monotonic(void)
 {
        struct timespec ts;
 
 {
        struct timespec ts;
 
-       clock_gettime(CLOCK_MONOTONIC, &ts);
+       if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+               /* TODO Report error cleanly up the chain. */
+               PERROR("clock_gettime CLOCK_MONOTONIC");
+               ts.tv_sec = 0;
+               ts.tv_nsec = 0;
+       }
        return ((uint64_t) ts.tv_sec * 1000000000ULL) + ts.tv_nsec;
 }
 
        return ((uint64_t) ts.tv_sec * 1000000000ULL) + ts.tv_nsec;
 }
 
This page took 0.022742 seconds and 4 git commands to generate.