Fix: typo in time_diff() with nsec difference
authorDavid Goulet <dgoulet@efficios.com>
Tue, 24 Jul 2012 17:37:10 +0000 (13:37 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 24 Jul 2012 17:37:10 +0000 (13:37 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/health.c

index 6c4de9430793fa1d8508c06dab17e88af0b6bcae..7bf41c883de16bbea20745f2e4650a5115597e1e 100644 (file)
@@ -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, &current_time);
-       if (ret) {
+       if (ret < 0) {
                PERROR("Error reading time\n");
                /* error */
                retval = 0;
This page took 0.025448 seconds and 4 git commands to generate.