summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-10-18 10:46:14 +0300
committerYaniv Kaul <ykaul@redhat.com>2019-10-18 10:48:49 +0300
commitd923d3a67d2b306114dec993da7ee9c59d7d5482 (patch)
tree29b08ef159e1cdfc9f091b3ed04bbfcb3842168f /xlators/storage/posix
parent105c7c5e7deaf9be29b81dc51f58dd5e5f8bd071 (diff)
posix-helper.c: fix compile warn: ‘timeout’ may be used uninitialized
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 <ykaul@redhat.com>
Diffstat (limited to 'xlators/storage/posix')
-rw-r--r--xlators/storage/posix/src/posix-helpers.c2
1 files changed, 1 insertions, 1 deletions
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);