disk/partfs: adding identical partition is no-op
This commit is contained in:
parent
b5cbd0bebd
commit
09b6a92145
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ addpart(char *name, vlong start, vlong end)
|
|||
}
|
||||
for (p = tab; p < tab + nelem(tab); p++)
|
||||
if (p->inuse && strcmp(p->name, name) == 0) {
|
||||
/* adding identical partition is no-op */
|
||||
if(p->offset == start && p->length == end - start)
|
||||
return 0;
|
||||
werrstr("partition name already in use");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue