X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fhealth.c;h=d382c04b536cc060fba5cb181e5e156696264924;hp=6c4de9430793fa1d8508c06dab17e88af0b6bcae;hb=f73fabfda365d22e7dd180fb1614e37c446fbd9e;hpb=8809eec0bb55b03862cb1eb128eb39d50104c258 diff --git a/src/bin/lttng-sessiond/health.c b/src/bin/lttng-sessiond/health.c index 6c4de9430..d382c04b5 100644 --- a/src/bin/lttng-sessiond/health.c +++ b/src/bin/lttng-sessiond/health.c @@ -43,7 +43,7 @@ static void time_diff(const struct timespec *time_a, res->tv_nsec = 1000000000L + time_a->tv_sec - time_b->tv_sec; } else { res->tv_sec = time_a->tv_sec - time_b->tv_sec; - res->tv_nsec = time_a->tv_sec - time_b->tv_sec; + res->tv_nsec = time_a->tv_nsec - time_b->tv_nsec; } } @@ -84,7 +84,7 @@ int health_check_state(struct health_state *state) current = uatomic_read(&state->current); ret = clock_gettime(CLOCK_MONOTONIC, ¤t_time); - if (ret) { + if (ret < 0) { PERROR("Error reading time\n"); /* error */ retval = 0; @@ -123,7 +123,7 @@ int health_check_state(struct health_state *state) } end: - DBG("Health state current %" PRIu64 ", last %" PRIu64 ", ret %d", + DBG("Health state current %lu, last %lu, ret %d", current, last, ret); return retval;