From d923d3a67d2b306114dec993da7ee9c59d7d5482 Mon Sep 17 00:00:00 2001 From: Yaniv Kaul Date: Fri, 18 Oct 2019 10:46:14 +0300 Subject: posix-helper.c: fix compile warn: ‘timeout’ may be used uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://review.gluster.org/#/c/glusterfs/+/23439/ introduced this warning: In file included from posix-helpers.c:50: posix-helpers.c: In function ‘posix_health_check_thread_proc’: ../../../../libglusterfs/src/glusterfs/events.h:31:9: warning: ‘timeout’ may be used uninitialized in this function [-Wmaybe-uninitialized] 31 | _gf_event(event, ##fmt); \ | ^~~~~~~~~ posix-helpers.c:2024:9: note: ‘timeout’ was declared here 2024 | int timeout; This patch fixes it, by re-setting the initial value to 0. Change-Id: I90aee4a1366e21a00f5e138f44247d8c42b0f5ae updates: bz#789278 Signed-off-by: Yaniv Kaul --- xlators/storage/posix/src/posix-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/storage/posix/src') diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 68034d27926..9c92c732e72 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -2021,7 +2021,7 @@ posix_fs_health_check(xlator_t *this, char *file_path) char *op = NULL; int op_errno = 0; int cnt; - int timeout; + int timeout = 0; struct aiocb aiocb; GF_VALIDATE_OR_GOTO(this->name, this, out); -- cgit