From: NeilBrown Date: Wed, 1 Jul 2015 22:16:59 +0000 (+1000) Subject: Manage: fix no-op test in Manage_stop. X-Git-Tag: mdadm-3.3.3~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52b6ccad34b1a6c974198f4b90b7ca15089b546d;p=thirdparty%2Fmdadm.git Manage: fix no-op test in Manage_stop. 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 --- diff --git a/Manage.c b/Manage.c index 4958cf8b..17d66de9 100644 --- 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)