ref: 09b6a92145540ca0f8b50454600e95c3dc17100f
parent: b5cbd0bebd32a2f9cb934ce5533819f62bed2781
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 30 18:37:46 EDT 2015
disk/partfs: adding identical partition is no-op
--- a/sys/src/cmd/disk/partfs.c
+++ b/sys/src/cmd/disk/partfs.c
@@ -69,6 +69,9 @@
}
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;
}