summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-26 07:12:48 +0000
committerNeil Brown <neilb@suse.de>2006-05-26 07:12:48 +0000
commit41a3b72a9ce75070eb614c42de6704fa61bb6086 (patch)
tree32bcc24716c9c69368966591b72dd2716b025934 /Assemble.c
parentd1f1011b94caa3506c63fb3d1d1a99dd282c7bc5 (diff)
downloadmdadm-41a3b72a9ce75070eb614c42de6704fa61bb6086.tar.gz
mdadm-41a3b72a9ce75070eb614c42de6704fa61bb6086.tar.xz
mdadm-41a3b72a9ce75070eb614c42de6704fa61bb6086.zip
Release 2.5mdadm-2.5
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c9
1 files changed, 7 insertions, 2 deletions
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 <ctype.h>
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;