util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@gnu.org>
To: Karel Zak <kzak@redhat.com>, Petr Uzel <petr.uzel@suse.cz>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: [PATCH] fdisk: fix menu
Date: Thu, 26 Jul 2012 16:16:57 +0200	[thread overview]
Message-ID: <1343312217.2609.11.camel@offbook> (raw)

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

Reported-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
 fdisks/fdisk.h |   12 ++++++------
 fdisks/utils.c |    2 --
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/fdisks/fdisk.h b/fdisks/fdisk.h
index 29b57fe..260445a 100644
--- a/fdisks/fdisk.h
+++ b/fdisks/fdisk.h
@@ -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;
diff --git a/fdisks/utils.c b/fdisks/utils.c
index c4ffe04..dbb422d 100644
--- a/fdisks/utils.c
+++ b/fdisks/utils.c
@@ -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[] =
 {
-- 
1.7.4.1




             reply	other threads:[~2012-07-26 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 14:16 Davidlohr Bueso [this message]
2012-07-26 15:26 ` [PATCH] fdisk: fix menu Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343312217.2609.11.camel@offbook \
    --to=dave@gnu.org \
    --cc=kzak@redhat.com \
    --cc=petr.uzel@suse.cz \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).