disk/partfs: adding identical partition is no-op

This commit is contained in:
cinap_lenrek 2015-05-30 22:37:46 +02:00
parent b5cbd0bebd
commit 09b6a92145

View file

@ -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;
}