summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2012-07-23 11:08:26 +0200
committerKarel Zak2012-07-23 11:08:26 +0200
commit84e18f7659ed8d311a5549936afba7f6d2101a79 (patch)
tree6a4d14517344b03d3c7158227290ffb218490151 /fdisks/fdisk.c
parentfdisk: get_boot() has to die (step I.) (diff)
downloadkernel-qcow2-util-linux-84e18f7659ed8d311a5549936afba7f6d2101a79.tar.gz
kernel-qcow2-util-linux-84e18f7659ed8d311a5549936afba7f6d2101a79.tar.xz
kernel-qcow2-util-linux-84e18f7659ed8d311a5549936afba7f6d2101a79.zip
fdisk: get_boot() has to die (step II.)
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
-rw-r--r--fdisks/fdisk.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c
index e24dd3bf4..1340ca49b 100644
--- a/fdisks/fdisk.c
+++ b/fdisks/fdisk.c
@@ -513,20 +513,6 @@ update_sector_offset(struct fdisk_context *cxt)
}
}
-/*
- * Read MBR. Returns:
- * -1: no 0xaa55 flag present (possibly entire disk BSD)
- * 0: found or created label
- * 1: I/O error
- */
-static int get_boot(struct fdisk_context *cxt, int try_only) {
- if (disklabel == ANY_LABEL) {
- if (try_only)
- return -1;
- }
- return 0;
-}
-
static int is_partition_table_changed(void)
{
int i;
@@ -1763,14 +1749,18 @@ static void print_partition_table_from_option(char *device, unsigned long sector
fdisk_context_set_user_geometry(cxt, user_cylinders,
user_heads, user_sectors);
gpt_warning(device);
- gb = get_boot(cxt, 1);
- if (gb < 0) { /* no DOS signature */
+
+ if (!fdisk_dev_has_disklabel(cxt)) {
+ /*
+ * Try BSD -- TODO: move to list_table() too
+ */
list_disk_geometry(cxt);
if (disklabel != AIX_LABEL && disklabel != MAC_LABEL)
btrydev(cxt);
}
- else if (!gb)
+ else
list_table(cxt, 0);
+
fdisk_free_context(cxt);
cxt = NULL;
}