summaryrefslogtreecommitdiffstats
path: root/fdisks/fdiskdoslabel.c
diff options
context:
space:
mode:
authorKarel Zak2013-01-21 12:32:33 +0100
committerKarel Zak2013-03-11 12:47:31 +0100
commite76d577627acec228e76c22f6e914b8d86d69c9b (patch)
tree95e41fc877f4fa85f727a66e353bb46e3c395566 /fdisks/fdiskdoslabel.c
parentfdisk: (dos) move dos specific code (diff)
downloadkernel-qcow2-util-linux-e76d577627acec228e76c22f6e914b8d86d69c9b.tar.gz
kernel-qcow2-util-linux-e76d577627acec228e76c22f6e914b8d86d69c9b.tar.xz
kernel-qcow2-util-linux-e76d577627acec228e76c22f6e914b8d86d69c9b.zip
fdisk: (dos) move 'toggle active' code to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdiskdoslabel.c')
-rw-r--r--fdisks/fdiskdoslabel.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fdisks/fdiskdoslabel.c b/fdisks/fdiskdoslabel.c
index 55b28c203..6655f3a07 100644
--- a/fdisks/fdiskdoslabel.c
+++ b/fdisks/fdiskdoslabel.c
@@ -1382,6 +1382,20 @@ void dos_move_begin(struct fdisk_context *cxt, int i)
}
}
+void dos_toggle_active(struct fdisk_context *cxt, int i)
+{
+ struct pte *pe = &ptes[i];
+ struct partition *p = pe->part_table;
+
+ if (IS_EXTENDED (p->sys_ind) && !p->boot_ind)
+ fprintf(stderr,
+ _("WARNING: Partition %d is an extended partition\n"),
+ i + 1);
+ p->boot_ind = (p->boot_ind ? 0 : ACTIVE_FLAG);
+ pe->changed = 1;
+ fdisk_label_set_changed(cxt->label, 1);
+}
+
static const struct fdisk_label_operations dos_operations =
{
.probe = dos_probe_label,