64664a
From a95f7a89ed81fb3d7c3135baae20b056b7f8e661 Mon Sep 17 00:00:00 2001
64664a
From: Karel Zak <kzak@redhat.com>
64664a
Date: Wed, 10 May 2017 15:26:55 +0200
64664a
Subject: [PATCH] libfdisk: (gpt) fix UUID printing
64664a
64664a
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1344726
64664a
Signed-off-by: Karel Zak <kzak@redhat.com>
64664a
---
64664a
 libfdisk/src/gpt.c | 14 +++-----------
64664a
 1 file changed, 3 insertions(+), 11 deletions(-)
64664a
64664a
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
64664a
index 899e1b2..612ce09 100644
64664a
--- a/libfdisk/src/gpt.c
64664a
+++ b/libfdisk/src/gpt.c
64664a
@@ -1690,7 +1690,7 @@ static int gpt_create_disklabel(struct fdisk_context *cxt)
64664a
 {
64664a
 	int rc = 0;
64664a
 	ssize_t esz = 0;
64664a
-	struct gpt_guid *uid;
64664a
+	char str[37];
64664a
 	struct fdisk_gpt_label *gpt;
64664a
 
64664a
 	assert(cxt);
64664a
@@ -1746,16 +1746,8 @@ static int gpt_create_disklabel(struct fdisk_context *cxt)
64664a
 	cxt->label->nparts_max = le32_to_cpu(gpt->pheader->npartition_entries);
64664a
 	cxt->label->nparts_cur = 0;
64664a
 
64664a
-	uid = &gpt->pheader->disk_guid;
64664a
-	fdisk_info(cxt, _("Building a new GPT disklabel "
64664a
-			    "(GUID: %08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X)\n"),
64664a
-			    uid->time_low, uid->time_mid,
64664a
-			    uid->time_hi_and_version,
64664a
-			    uid->clock_seq_hi,
64664a
-			    uid->clock_seq_low,
64664a
-			    uid->node[0], uid->node[1],
64664a
-			    uid->node[2], uid->node[3],
64664a
-			    uid->node[4], uid->node[5]);
64664a
+	guid_to_string(&gpt->pheader->disk_guid, str);
64664a
+	fdisk_info(cxt, _("Building a new GPT disklabel (GUID: %s)\n"), str);
64664a
 	fdisk_label_set_changed(cxt->label, 1);
64664a
 done:
64664a
 	return rc;
64664a
-- 
64664a
2.9.3
64664a