Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Feb 2011 14:49:49 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218853 - head/usr.sbin/bsdinstall/partedit
Message-ID:  <201102191449.p1JEnn2v099371@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sat Feb 19 14:49:49 2011
New Revision: 218853
URL: http://svn.freebsd.org/changeset/base/218853

Log:
  The PC98 gpart module supports labels now.

Modified:
  head/usr.sbin/bsdinstall/partedit/gpart_ops.c

Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c
==============================================================================
--- head/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sat Feb 19 14:27:14 2011	(r218852)
+++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sat Feb 19 14:49:49 2011	(r218853)
@@ -65,6 +65,19 @@ gpart_show_error(const char *title, cons
 	dialog_msgbox(title, message, 0, 0, TRUE);
 }
 
+static int
+scheme_supports_labels(const char *scheme)
+{
+	if (strcmp(scheme, "APM") == 0)
+		return (1);
+	if (strcmp(scheme, "GPT") == 0)
+		return (1);
+	if (strcmp(scheme, "PC98") == 0)
+		return (1);
+
+	return (0);
+}
+
 int
 gpart_partition(const char *lg_name, const char *scheme)
 {
@@ -389,11 +402,7 @@ gpart_edit(struct gprovider *pp)
 		}
 	}
 
-	/* Labels only supported on GPT and APM */
-	if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0)
-		nitems = 4;
-	else
-		nitems = 3;
+	nitems = scheme_supports_labels(scheme) ? 4 : 3;
 
 	/* Edit editable parameters of a partition */
 	hadlabel = 0;
@@ -738,11 +747,7 @@ gpart_create(struct gprovider *pp, char 
 	if (strcmp(scheme, "MBR") == 0 || strcmp(scheme, "PC98") == 0)
 		items[0].text = "freebsd";
 
-	/* Labels only supported on GPT and APM */
-	if (strcmp(scheme, "GPT") == 0 || strcmp(scheme, "APM") == 0)
-		nitems = 4;
-	else
-		nitems = 3;
+	nitems = scheme_supports_labels(scheme) ? 4 : 3;
 
 	if (default_type != NULL)
 		items[0].text = default_type;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102191449.p1JEnn2v099371>