ref: 3ceedfd1e1cdb643d8a0bbbbdd58badc5cc3fae8
parent: de3c058efbc7163d71b2ac965e2a45ea4c4d3668
author: cinap_lenrek <[email protected]>
date: Sat May 30 18:24:55 EDT 2015
nusb/disk: adding identical partition is a no-op
--- a/sys/src/cmd/nusb/disk/disk.c
+++ b/sys/src/cmd/nusb/disk/disk.c
@@ -75,7 +75,11 @@
werrstr("bad partition boundaries");
return -1;
}
- if(lookpart(lun, name) != nil) {
+ p = lookpart(lun, name);
+ if(p != nil){
+ /* adding identical partition is no-op */
+ if(p->offset == start && p->length == end - start && p->mode == mode)
+ return 0;
werrstr("partition name already in use");
return -1;
}