diff options
author | Karel Zak | 2013-01-28 16:16:11 +0100 |
---|---|---|
committer | Karel Zak | 2013-03-11 13:00:54 +0100 |
commit | 416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb (patch) | |
tree | e80ace8d76f33e4a63a2df58c1a35597e104d130 /fdisks/fdisk.c | |
parent | libfdisk: add "ask" interface (diff) | |
download | kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.tar.gz kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.tar.xz kernel-qcow2-util-linux-416c43a9a5519ae0e4c91e075cf42c5cf0b5cbcb.zip |
fdisk: add callback for ask-numbers API
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
-rw-r--r-- | fdisks/fdisk.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c index 094b7e0f6..453583ee1 100644 --- a/fdisks/fdisk.c +++ b/fdisks/fdisk.c @@ -752,19 +752,13 @@ void print_partition_size(struct fdisk_context *cxt, static void new_partition(struct fdisk_context *cxt) { - int partnum = 0; - assert(cxt); assert(cxt->label); if (warn_geometry(cxt)) return; - if (!(cxt->label->flags & FDISK_LABEL_FL_ADDPART_NOPARTNO)) - partnum = get_partition_dflt(cxt, 0, cxt->label->nparts_max, - cxt->label->nparts_cur + 1); - - fdisk_add_partition(cxt, partnum, NULL); + fdisk_add_partition(cxt, NULL); } static void write_table(struct fdisk_context *cxt) @@ -1197,6 +1191,8 @@ int main(int argc, char **argv) if (!cxt) err(EXIT_FAILURE, _("failed to allocate libfdisk context")); + fdisk_context_set_ask(cxt, ask_callback, NULL); + while ((c = getopt(argc, argv, "b:c::C:hH:lsS:u::vV")) != -1) { switch (c) { case 'b': |