Clean-up: liblttng-ctl: fix two trivial -Wshadow errors
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 31 Mar 2021 18:53:04 +0000 (14:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:22:08 +0000 (16:22 -0400)
Fix two similar cases by declaring a variable in a narrower scope.

Change-Id: I6e36f4cf07086ccb5e58a175aff04671cc64323d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/clear.c
src/lib/lttng-ctl/destruction-handle.c

index 9beec7240fbc744c7d17b56e2a5b07e8fef098bd..060e2d0f2f986e68922a4c14a7a5f818d49204e5 100644 (file)
@@ -173,7 +173,6 @@ extern enum lttng_clear_handle_status
        lttng_clear_handle_wait_for_completion(
                struct lttng_clear_handle *handle, int timeout_ms)
 {
-       int ret;
        enum lttng_clear_handle_status status;
        unsigned long time_left_ms = 0;
        const bool has_timeout = timeout_ms > 0;
@@ -187,7 +186,7 @@ extern enum lttng_clear_handle_status
                goto end;
        }
        if (has_timeout) {
-               ret = lttng_clock_gettime(CLOCK_MONOTONIC, &initial_time);
+               int ret = lttng_clock_gettime(CLOCK_MONOTONIC, &initial_time);
                if (ret) {
                        status = LTTNG_CLEAR_HANDLE_STATUS_ERROR;
                        goto end;
index aeeece7e316abad31884c5498667b1fb09f60f3c..965a823d8085f8a1379399df87d4a733cbe696ba 100644 (file)
@@ -227,7 +227,6 @@ enum lttng_destruction_handle_status
 lttng_destruction_handle_wait_for_completion(
                struct lttng_destruction_handle *handle, int timeout_ms)
 {
-       int ret;
        enum lttng_destruction_handle_status status;
        unsigned long time_left_ms = 0;
        const bool has_timeout = timeout_ms > 0;
@@ -246,7 +245,7 @@ lttng_destruction_handle_wait_for_completion(
                goto end;
        }
        if (has_timeout) {
-               ret = lttng_clock_gettime(CLOCK_MONOTONIC, &initial_time);
+               int ret = lttng_clock_gettime(CLOCK_MONOTONIC, &initial_time);
                if (ret) {
                        status = LTTNG_DESTRUCTION_HANDLE_STATUS_ERROR;
                        goto end;
This page took 0.030973 seconds and 5 git commands to generate.