From 5989556ad3dca8246f245eaf0867e89fb6fc9362 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 11 Jun 2015 14:19:47 +0200 Subject: libfdisk: add new API to read label specific data * removes list() label operation from internal API The list() has been based on fdisk_info() it was useless for anything else than print on stdout... * add a new get_item() label operation and fdisk_get_disklabel_item() public API The new API provides abstract and pretty simple way how to get label specific disk label information, for example fdisk_get_disklabel_item(cxt, GPT_LABELITEM_ENTRIESLBA, &iterm); return LBA of the array with GPT entries. Note that this patch does not implement public functions to get data from the @item object. * removes get_id() label operation -- it's subset of the new get_item() * the new internal API is also used to implement backwardly compatible fdisk_list_disklabel() and fdisk_get_disklabel_id() Signed-off-by: Karel Zak --- disk-utils/fdisk-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'disk-utils/fdisk-list.c') diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c index b2b528e97..5ef92b13c 100644 --- a/disk-utils/fdisk-list.c +++ b/disk-utils/fdisk-list.c @@ -75,7 +75,7 @@ void list_disk_geometry(struct fdisk_context *cxt) fdisk_info(cxt, _("Disklabel type: %s"), fdisk_label_get_name(lb)); - if (fdisk_get_disklabel_id(cxt, &id) == 0 && id) + if (!fdisk_is_details(cxt) && fdisk_get_disklabel_id(cxt, &id) == 0 && id) fdisk_info(cxt, _("Disk identifier: %s"), id); } -- cgit v1.2.3-55-g7522