diff options
author | Karel Zak | 2013-06-27 10:54:19 +0200 |
---|---|---|
committer | Karel Zak | 2013-09-16 16:47:05 +0200 |
commit | 818d79246126787347860dfbcf697c38918c02ff (patch) | |
tree | b0c3be2682bc1e44b3bd458d981212bdcecf5551 /fdisks/fdisk-menu.c | |
parent | libfdisk: improve nested context initialization (diff) | |
download | kernel-qcow2-util-linux-818d79246126787347860dfbcf697c38918c02ff.tar.gz kernel-qcow2-util-linux-818d79246126787347860dfbcf697c38918c02ff.tar.xz kernel-qcow2-util-linux-818d79246126787347860dfbcf697c38918c02ff.zip |
fdisk: (bsd) cleanup driver initialization
- assume DOS partition only for nested BSD (cxt->parent is set)
- don't create BSD label in label probe function, require
fdisk_create_disklabel() call
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk-menu.c')
-rw-r--r-- | fdisks/fdisk-menu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fdisks/fdisk-menu.c b/fdisks/fdisk-menu.c index 541e00d48..d8e157827 100644 --- a/fdisks/fdisk-menu.c +++ b/fdisks/fdisk-menu.c @@ -295,8 +295,8 @@ static int menu_detect_collisions(struct fdisk_context *cxt) if (r != e) { DBG(FRONTEND, dbgprint("warning: duplicate key '%c'", e->key)); - DBG(FRONTEND, dbgprint(" %s", e->title)); - DBG(FRONTEND, dbgprint(" %s", r->title)); + DBG(FRONTEND, dbgprint(" : %s", e->title)); + DBG(FRONTEND, dbgprint(" : %s", r->title)); abort(); } } @@ -438,7 +438,11 @@ static int dos_menu_cb(struct fdisk_context *cxt, { struct fdisk_context *bsd = fdisk_new_nested_context(cxt, "bsd"); - if (bsd) + if (!bsd) + return -ENOMEM; + if (!fdisk_dev_has_disklabel(bsd)) + rc = fdisk_create_disklabel(bsd, "bsd"); + if (!rc) bsd_command_prompt(bsd); fdisk_free_context(bsd); break; |