svn commit: r217501 - user/nwhitehorn/bsdinstall/partedit

Nathan Whitehorn nwhitehorn at FreeBSD.org
Mon Jan 17 14:44:17 UTC 2011


Author: nwhitehorn
Date: Mon Jan 17 14:44:16 2011
New Revision: 217501
URL: http://svn.freebsd.org/changeset/base/217501

Log:
  Fix adding of sub-partitions to a geom that has been deleted but where the
  deletion has yet to be committed.
  
  Reported by:	jh

Modified:
  user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
  user/nwhitehorn/bsdinstall/partedit/part_wizard.c

Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Mon Jan 17 05:45:55 2011	(r217500)
+++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Mon Jan 17 14:44:16 2011	(r217501)
@@ -667,7 +667,15 @@ gpart_create(struct gprovider *pp, char 
 	if (geom == NULL && strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0)
 		geom = pp->lg_geom;
 
-	if (geom == NULL) {
+	/* Now get the partition scheme */
+	scheme = NULL;
+	if (geom != NULL) {
+		LIST_FOREACH(gc, &geom->lg_config, lg_config) 
+			if (strcmp(gc->lg_name, "scheme") == 0)
+				scheme = gc->lg_val;
+	}
+
+	if (geom == NULL || scheme == NULL || strcmp(scheme, "(none)") == 0) {
 		if (gpart_partition(pp->lg_geom->lg_name, NULL) == 0)
 			dialog_msgbox("",
 			    "The partition table has been successfully created."
@@ -685,11 +693,6 @@ gpart_create(struct gprovider *pp, char 
 	if (geom == NULL)
 		return;
 
-	/* Now get the partition scheme */
-	LIST_FOREACH(gc, &geom->lg_config, lg_config) 
-		if (strcmp(gc->lg_name, "scheme") == 0)
-			scheme = gc->lg_val;
-
 	size = gpart_max_free(geom, &firstfree);
 	if (size <= 0) {
 		dialog_msgbox("Error", "No free space left on device.", 0, 0,

Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Mon Jan 17 05:45:55 2011	(r217500)
+++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Mon Jan 17 14:44:16 2011	(r217501)
@@ -188,7 +188,7 @@ query:
 	dialog_vars.no_label = NULL;
 	dialog_vars.defaultno = FALSE;
 
-	if (scheme == NULL || choice == 0) { /* Entire disk */
+	if (scheme == NULL || strcmp(scheme, "(none)") == 0 || choice == 0) {
 		if (gpart != NULL) { /* Erase partitioned disk */
 			choice = dialog_yesno("Confirmation", "This will erase "
 			   "the disk. Are you sure you want to proceed?", 0, 0);


More information about the svn-src-user mailing list