summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdopen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdopen.c b/mdopen.c
index a37eb9c3..293ac25d 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -311,7 +311,10 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
conflict = 0;
}
}
- if (cname[0] == 0)
+
+ if (dev)
+ strcpy(chosen, dev);
+ else if (cname[0] == 0)
strcpy(chosen, devname);
/* We have a device number and name.