Fix: Dead code when checking return value from (ust_app|kernel)_snapshot_record
authorChristian Babeux <christian.babeux@efficios.com>
Mon, 5 Aug 2013 19:11:30 +0000 (15:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 5 Aug 2013 19:11:30 +0000 (15:11 -0400)
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 84594ad24927bf9ab4771d534f4dc8f88360491e..e9fa3b462d29d533583815296d3ed20c6723ce8e 100644 (file)
@@ -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;
        }
 
This page took 0.027427 seconds and 4 git commands to generate.