]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm.c:fix compile warning "mdfd is uninitialized"
authorZhilong Liu <zlliu@suse.com>
Mon, 10 Apr 2017 04:49:52 +0000 (12:49 +0800)
committerJes Sorensen <Jes.Sorensen@gmail.com>
Tue, 11 Apr 2017 15:27:53 +0000 (11:27 -0400)
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 <zlliu@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index 001ff6848c6149b2fc702ff391a97e2032ae9098..41dae1dbcbb40f19b3ffdd4bb8f0dd0af5895824 100644 (file)
--- 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':