diff options
| author | Karel Zak <kzak@redhat.com> | 2013-06-25 14:40:34 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2013-09-16 16:47:03 +0200 |
| commit | 21fe3dde849c59a54641f43cbea2eafdf4d07acf (patch) | |
| tree | 8837f15625af39295e75e6a2b006e7d881717fcb /fdisks/fdisk.c | |
| parent | 9af7ed4eab9a66e28e4fdf9a40fc2f6b415c87c4 (diff) | |
| download | util-linux-21fe3dde849c59a54641f43cbea2eafdf4d07acf.tar.gz | |
libfdisk: add generic function to get disklabel ID
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
| -rw-r--r-- | fdisks/fdisk.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index dae7986f..803eeeed 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -229,8 +229,9 @@ static void change_partition_type(struct fdisk_context *cxt) fdisk_free_parttype(org_t); } -static void -list_disk_geometry(struct fdisk_context *cxt) { +static void list_disk_geometry(struct fdisk_context *cxt) +{ + char *id = NULL; unsigned long long bytes = cxt->total_sectors * cxt->sector_size; long megabytes = bytes/1000000; @@ -262,8 +263,9 @@ list_disk_geometry(struct fdisk_context *cxt) { printf(_("Alignment offset: %lu bytes\n"), cxt->alignment_offset); if (fdisk_dev_has_disklabel(cxt)) printf(_("Disk label type: %s\n"), cxt->label->name); - if (fdisk_is_disklabel(cxt, DOS)) - dos_print_mbr_id(cxt); + + if (fdisk_get_disklabel_id(cxt, &id) == 0 && id) + printf(_("Disk identifier: %s\n"), id); printf("\n"); } |
