dcavalca / rpms / util-linux

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