From: Christian Babeux Date: Mon, 5 Aug 2013 19:11:30 +0000 (-0400) Subject: Fix: Dead code when checking return value from (ust_app|kernel)_snapshot_record X-Git-Tag: v2.3.0-rc3~64 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=86170a9ca6e51992d8d94ded9baf8e7569fad770 Fix: Dead code when checking return value from (ust_app|kernel)_snapshot_record Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 84594ad24..e9fa3b462 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -2590,10 +2590,12 @@ static int record_kernel_snapshot(struct ltt_kernel_session *ksess, ret = kernel_snapshot_record(ksess, output, wait, nb_streams); if (ret < 0) { - ret = LTTNG_ERR_SNAPSHOT_FAIL; if (ret == -EINVAL) { ret = LTTNG_ERR_INVALID; + goto error_snapshot; } + + ret = LTTNG_ERR_SNAPSHOT_FAIL; goto error_snapshot; } @@ -2646,10 +2648,12 @@ static int record_ust_snapshot(struct ltt_ust_session *usess, ret = ust_app_snapshot_record(usess, output, wait, nb_streams); if (ret < 0) { - ret = LTTNG_ERR_SNAPSHOT_FAIL; if (ret == -EINVAL) { ret = LTTNG_ERR_INVALID; + goto error_snapshot; } + + ret = LTTNG_ERR_SNAPSHOT_FAIL; goto error_snapshot; }