]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Close mdfd before returning main function
authorXiao Ni <xni@redhat.com>
Tue, 19 Sep 2017 06:06:46 +0000 (14:06 +0800)
committerJes Sorensen <jsorensen@fb.com>
Mon, 2 Oct 2017 17:26:07 +0000 (13:26 -0400)
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mdadm.c

diff --git a/mdadm.c b/mdadm.c
index d80aab3612641d196d06a96c49e54b91a9cf8681..7cdcdba7c652248a74b9a49f90f0f56648f1a2b6 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -1734,6 +1734,8 @@ int main(int argc, char *argv[])
                autodetect();
                break;
        }
+       if (mdfd > 0)
+               close(mdfd);
        exit(rv);
 }