From 5fbc1f1527ec86ae904739a27c0af4e3bc89084e Mon Sep 17 00:00:00 2001 From: Zhilong Liu Date: Mon, 10 Apr 2017 12:49:52 +0800 Subject: [PATCH] mdadm.c:fix compile warning "mdfd is uninitialized" Initialized the mdfd as -1 to prevent compile error of some compilers. For example, gcc version 4.8.5(SUSE Linux). Signed-off-by: Zhilong Liu Signed-off-by: Jes Sorensen --- mdadm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdadm.c b/mdadm.c index 001ff684..41dae1db 100644 --- a/mdadm.c +++ b/mdadm.c @@ -1916,7 +1916,7 @@ static int misc_list(struct mddev_dev *devlist, int rv = 0; for (dv = devlist; dv; dv = (rv & 16) ? NULL : dv->next) { - int mdfd; + int mdfd = -1; switch(dv->disposition) { case 'D': -- 2.39.2