Skip to contentSkip to conversation

fdisk: API: fix fdisk_label_create

PATCH In review Davidlohr Bueso 2 participants 2 messages Jul 22, 2012 – Jul 24, 2012 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 9/10 fdisk: API: fix fdisk_label_create

From: Davidlohr Bueso <[email protected]>

It wasn't actually calling create_label(), silly me!

---
 fdisks/utils.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
fdisks/utils.c +7 -5
index 62cd6aa..510d641 100644
@@ -143,11 +143,13 @@ int fdisk_label_create(struct fdisk_context *cxt, const char *name)
 #else
 		errcode = fdisk_label_change(cxt, "dos");
 #endif
-		if (errcode)
-			goto done;
-	}
-	
-	errcode = fdisk_label_change(cxt, name);
+	} else
+		errcode = fdisk_label_change(cxt, name);
+
+	if (errcode)
+		goto done;
+
+	errcode = cxt->label->create_label(cxt);
 done:
 	return errcode;
 }
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw

fdisks/utils.c int fdisk_label_create(struct fdisk_context *cxt, const char *name) · line 154

Quoted 9 lines · Davidlohr Bueso
fdisks/utils.c +7 -0
+	} else
+		errcode = fdisk_label_change(cxt, name);
+
+	if (errcode)
+		goto done;
+
+	errcode = cxt->label->create_label(cxt);
 done:
 	return errcode;

Unnecessary for the current code.

karel

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