Fix: missing LTTNG_OK return value for snapshot
authorDavid Goulet <dgoulet@efficios.com>
Mon, 4 Nov 2013 21:24:25 +0000 (16:24 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 4 Nov 2013 21:24:25 +0000 (16:24 -0500)
After a successful kernel snapshot, the ret = LTTNG_OK was missing thus
returning 0 to the caller which was expecting LTTNG_OK.

Also, this patch fixes the live_timer_interval check at start that CAN
be -1 thus not trying to start it.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/kernel.c
src/common/consumer-timer.c

index 8dd3fcc60c914c9df4979ac46150aea1c518c147..082e3456f707aab2b70d134e2708ef1837436ee6 100644 (file)
@@ -2738,7 +2738,7 @@ error:
 /*
  * Record a kernel snapshot.
  *
- * Return 0 on success or a LTTNG_ERR code.
+ * Return LTTNG_OK on success or a LTTNG_ERR code.
  */
 static int record_kernel_snapshot(struct ltt_kernel_session *ksess,
                struct snapshot_output *output, struct ltt_session *session,
index 123be4be523d24194309cc93e5c9a52e9fba16c7..9e7826808f7181b9546de2d69956e1820e6515c4 100644 (file)
@@ -927,6 +927,8 @@ int kernel_snapshot_record(struct ltt_kernel_session *ksess,
                (void) kernel_consumer_destroy_metadata(socket, ksess->metadata);
        }
 
+       ret = LTTNG_OK;
+
 error_consumer:
        /* Close newly opened metadata stream. It's now on the consumer side. */
        err = close(ksess->metadata_stream_fd);
index 1571d86de78b95437d7f7ab833af79129a6b39e2..b97cb28443a99232550de4d543b2607896452ead 100644 (file)
@@ -397,7 +397,7 @@ void consumer_timer_live_start(struct lttng_consumer_channel *channel,
        assert(channel);
        assert(channel->key);
 
-       if (live_timer_interval == 0) {
+       if (live_timer_interval <= 0) {
                return;
        }
 
This page took 0.030115 seconds and 4 git commands to generate.