Skip to contentSkip to conversation

fdisk: de-duplicate disk label strings

PATCH In review Bernhard Voelker 2 participants 2 messages Jul 24, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdisk: de-duplicate disk label strings

Quoted 3 lines

From 91b486e98aaa72083ffec491b931dbab368e8a19 Mon Sep 17 00:00:00 2001

From: Bernhard Voelker <[email protected]>
Date: Tue, 24 Jul 2012 13:18:16 +0200
Subject: [PATCH] fdisk: de-duplicate disk label strings

---
 fdisks/fdisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fdisks/fdisk.c +3 -3
index 4731918..9f06901 100644
@@ -1528,7 +1528,7 @@ expert_command_prompt(struct fdisk_context *cxt)
 				fix_partition_table_order();
 			break;
 		case 'g':
-			fdisk_create_disklabel(cxt, "sgi");
+			fdisk_create_disklabel(cxt, sgi_label.name);
 			break;
 		case 'h':
 			user_heads = cxt->geom.heads = read_int(cxt, 1, cxt->geom.heads, 256, 0,
@@ -1755,7 +1755,7 @@ static void command_prompt(struct fdisk_context *cxt)
 			new_partition(cxt);
 			break;
 		case 'o':
-			fdisk_create_disklabel(cxt, "dos");
+			fdisk_create_disklabel(cxt, dos_label.name);
 			break;
 		case 'p':
 			list_table(cxt, 0);
@@ -1763,7 +1763,7 @@ static void command_prompt(struct fdisk_context *cxt)
 		case 'q':
 			handle_quit(cxt);
 		case 's':
-			fdisk_create_disklabel(cxt, "sun");
+			fdisk_create_disklabel(cxt, sun_label.name);
 			break;
 		case 't':
 			change_sysid(cxt);
Signature · 1 line
1.7.7
maintainer
#1 lore raw
Quoted 2 lines · Bernhard Voelker
 fdisks/fdisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Hmm.. applied and reverted (this happen if your fingers are faster than your brain..).

The xxx_label structs will be completely encapsulated in libfdisk and inaccessible for applications (like fdisk.c).

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com