fix remove_devices()
Don't write to 'pe' if 'path' was not specified Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
92bd8f8d3f
commit
ef70b9f4ef
2
Manage.c
2
Manage.c
|
@ -150,11 +150,13 @@ static void remove_devices(int devnum, char *path)
|
||||||
for (part = 0; part < 16; part++) {
|
for (part = 0; part < 16; part++) {
|
||||||
if (part) {
|
if (part) {
|
||||||
sprintf(be, "p%d", part);
|
sprintf(be, "p%d", part);
|
||||||
|
if (path) {
|
||||||
if (isdigit(pe[-1]))
|
if (isdigit(pe[-1]))
|
||||||
sprintf(pe, "p%d", part);
|
sprintf(pe, "p%d", part);
|
||||||
else
|
else
|
||||||
sprintf(pe, "%d", part);
|
sprintf(pe, "%d", part);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* FIXME test if really is md device ?? */
|
/* FIXME test if really is md device ?? */
|
||||||
unlink(base);
|
unlink(base);
|
||||||
if (path) {
|
if (path) {
|
||||||
|
|
Loading…
Reference in New Issue