From: David Goulet Date: Mon, 4 Nov 2013 21:24:25 +0000 (-0500) Subject: Fix: missing LTTNG_OK return value for snapshot X-Git-Tag: v2.4.0-rc1~79 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fac41e72fd9335dd3ab372a74b96dff5dc2cdbdf;p=lttng-tools.git Fix: missing LTTNG_OK return value for snapshot 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 Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 8dd3fcc60..082e3456f 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -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, diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 123be4be5..9e7826808 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -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); diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index 1571d86de..b97cb2844 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -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; }