summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdopen.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mdopen.c b/mdopen.c
index d322cf4..ed53d6f 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -156,7 +156,6 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
if (dev) {
-
if (strncmp(dev, "/dev/md/", 8) == 0) {
strcpy(cname, dev+8);
} else if (strncmp(dev, "/dev/", 5) == 0) {
@@ -307,7 +306,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
}
}
- if (dev)
+ if (dev && dev[0] == '/')
strcpy(chosen, dev);
else if (cname[0] == 0)
strcpy(chosen, devname);