From 41a3b72a9ce75070eb614c42de6704fa61bb6086 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 26 May 2006 07:12:48 +0000 Subject: Release 2.5 Signed-off-by: Neil Brown --- Assemble.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Assemble.c') diff --git a/Assemble.c b/Assemble.c index 75da9a5..816a88e 100644 --- a/Assemble.c +++ b/Assemble.c @@ -28,6 +28,7 @@ */ #include "mdadm.h" +#include static int name_matches(char *found, char *required, char *homehost) { @@ -112,7 +113,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, */ int must_close = 0; int old_linux = 0; - int vers; + int vers = 0; /* Keep gcc quite - it really is initialised */ void *first_super = NULL, *super = NULL; struct { char *devname; @@ -376,7 +377,11 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, st->ss->getinfo_super(&info, first_super); c = strchr(info.name, ':'); if (c) c++; else c= info.name; - asprintf(&mddev, "/dev/md/%s", c); + if (isdigit(*c) && ((ident->autof & 7)==4 || (ident->autof&7)==6)) + /* /dev/md/d0 style for partitionable */ + asprintf(&mddev, "/dev/md/d%s", c); + else + asprintf(&mddev, "/dev/md/%s", c); mdfd = open_mddev(mddev, ident->autof); if (mdfd < 0) return mdfd; -- cgit