]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Manage: fix no-op test in Manage_stop.
authorNeilBrown <neilb@suse.de>
Wed, 1 Jul 2015 22:16:59 +0000 (08:16 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 1 Jul 2015 22:16:59 +0000 (08:16 +1000)
A 'devnm' never starts with '/', so this test is pointless.
The code should use the passed-in devname unless it is clearly
not usable.  So fix it to do that.

Signed-off-by: NeilBrown <neilb@suse.de>
Manage.c

index 4958cf8b838238953b5e5749382014f1cd406943..17d66de9c08f29f9d5fd213c6ff80229da68337f 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -235,7 +235,7 @@ int Manage_stop(char *devname, int fd, int verbose, int will_retry)
                container[0] = 0;
        close(fd);
        count = 5;
-       while (((fd = ((devnm[0] == '/')
+       while (((fd = ((devname[0] == '/')
                       ?open(devname, O_RDONLY|O_EXCL)
                       :open_dev_flags(devnm, O_RDONLY|O_EXCL))) < 0
                || strcmp(fd2devnm(fd), devnm) != 0)