diff options
-rw-r--r-- | disk/part_dos.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c index 9e29aa6..94fae71 100644 --- a/disk/part_dos.c +++ b/disk/part_dos.c @@ -459,10 +459,12 @@ int layout_mbr_partitions(struct disk_partition *p, int count, ext = &p[i]; } - if (i >= 4 && !ext) { - printf("%s: extended partition is needed for more than 4 partitions\n", - __func__); - return -1; + if (count < 4) + return 0; + + if (!ext) { + log_err("extended partition is needed for more than 4 partitions\n"); + return -EINVAL; } /* calculate extended volumes start and size if needed */ |