From bf3683d012853565709875a6b556941cc62e05af Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 31 Mar 2021 14:53:04 -0400 Subject: [PATCH 1/1] Clean-up: liblttng-ctl: fix two trivial -Wshadow errors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix two similar cases by declaring a variable in a narrower scope. Change-Id: I6e36f4cf07086ccb5e58a175aff04671cc64323d Signed-off-by: Simon Marchi Signed-off-by: Jérémie Galarneau --- src/lib/lttng-ctl/clear.c | 3 +-- src/lib/lttng-ctl/destruction-handle.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/lttng-ctl/clear.c b/src/lib/lttng-ctl/clear.c index 9beec7240..060e2d0f2 100644 --- a/src/lib/lttng-ctl/clear.c +++ b/src/lib/lttng-ctl/clear.c @@ -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; diff --git a/src/lib/lttng-ctl/destruction-handle.c b/src/lib/lttng-ctl/destruction-handle.c index aeeece7e3..965a823d8 100644 --- a/src/lib/lttng-ctl/destruction-handle.c +++ b/src/lib/lttng-ctl/destruction-handle.c @@ -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; -- 2.34.1