]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: make the cylinder boundary check less fatal
authorPetr Uzel <petr.uzel@suse.cz>
Mon, 19 Sep 2011 13:29:11 +0000 (15:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Sep 2011 13:24:00 +0000 (15:24 +0200)
If the specified format is not cylinders, make the cylinder boundary
check only print a warning and proceed anyways.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
fdisk/sfdisk.c

index 2c9de8f3258622e6ed8acbf78b42a57da9ef0e4f..820e23e9cf7b404d80e5ff88d0f4ed632412104a 100644 (file)
@@ -1313,12 +1313,14 @@ partitions_ok(struct disk_desc *z) {
                    && (p->p.start_sect >= B.cylindersize)) {
                    my_warn(_("Warning: partition %s does not start "
                              "at a cylinder boundary\n"), PNO(p));
-                   return 0;
+                   if (specified_format == F_CYLINDER)
+                       return 0;
                }
                if ((p->start + p->size) % B.cylindersize) {
                    my_warn(_("Warning: partition %s does not end "
                              "at a cylinder boundary\n"), PNO(p));
-                   return 0;
+                   if (specified_format == F_CYLINDER)
+                       return 0;
                }
            }
     }