From: Simon Marchi Date: Wed, 31 Mar 2021 18:53:04 +0000 (-0400) Subject: Clean-up: liblttng-ctl: fix two trivial -Wshadow errors X-Git-Tag: v2.13.0-rc1~130 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bf3683d012853565709875a6b556941cc62e05af;p=lttng-tools.git Clean-up: liblttng-ctl: fix two trivial -Wshadow errors 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 --- 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;