Skip to contentSkip to conversation

fdisk: fix menu

PATCH Applied Davidlohr Bueso 2 participants 2 messages Jul 26, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fdisk: fix menu

Commit 79c8a145ddff98d9c5bc70e67c5a861f67c50484 changed the numerical values of fdisk_labeltype and broke the menu functionality, mixing main and expert menus. Revert this change along with the label comment regarding it matching labeltype.

This is no longer valid since the original patch that lead to this modification assumed that __probe_labels() would use these indices when creating a default DOS/SUN disklabel, see http://www.spinics.net/lists/util-linux-ng/msg06509.html

---
 fdisks/fdisk.h |   12 ++++++------
 fdisks/utils.c |    2 --
 2 files changed, 6 insertions(+), 8 deletions(-)
fdisks/fdisk.h +6 -6
index 29b57fe..260445a 100644
@@ -226,13 +226,13 @@ extern sector_t get_nr_sects(struct partition *p);
  * Supported partition table types (labels)
  */
 enum fdisk_labeltype {
-	ANY_LABEL = -1,
 	DOS_LABEL = 1,
-	SUN_LABEL,
-	SGI_LABEL,
-	AIX_LABEL,
-	OSF_LABEL,
-	MAC_LABEL,
+	SUN_LABEL = 2,
+	SGI_LABEL = 4,
+	AIX_LABEL = 8,
+	OSF_LABEL = 16,
+	MAC_LABEL = 32,
+	ANY_LABEL = -1
 };
 
 extern enum fdisk_labeltype disklabel;
fdisks/utils.c +0 -2
index c4ffe04..dbb422d 100644
@@ -36,8 +36,6 @@ int fdisk_debug_mask;
 
 /*
  * Label probing functions.
- * Must have the same order as fdisk_labeltype as the index
- * depends on it.
  */
 static const struct fdisk_label *labels[] =
 {
Signature · 1 line
1.7.4.1
maintainer Applied
#1 lore raw
Quoted 3 lines · Davidlohr Bueso
 fdisks/fdisk.h |   12 ++++++------
 fdisks/utils.c |    2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

Applied, thanks.

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