summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisksgilabel.c
diff options
context:
space:
mode:
authorKarel Zak2012-09-26 14:14:54 +0200
committerKarel Zak2012-09-27 13:38:13 +0200
commited470672bbbfeb160008cecb28c2a443e755d289 (patch)
tree4ad124f5ac82f45fd1944e2d3f0bb81cea77de90 /fdisks/fdisksgilabel.c
parentfdisk: add fdisk_set_partition_type() (diff)
downloadkernel-qcow2-util-linux-ed470672bbbfeb160008cecb28c2a443e755d289.tar.gz
kernel-qcow2-util-linux-ed470672bbbfeb160008cecb28c2a443e755d289.tar.xz
kernel-qcow2-util-linux-ed470672bbbfeb160008cecb28c2a443e755d289.zip
fdisk: use fdisk_parttype in add_partition
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisksgilabel.c')
-rw-r--r--fdisks/fdisksgilabel.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fdisks/fdisksgilabel.c b/fdisks/fdisksgilabel.c
index 6cef145e4..aa46fd5ff 100644
--- a/fdisks/fdisksgilabel.c
+++ b/fdisks/fdisksgilabel.c
@@ -636,16 +636,18 @@ static void sgi_delete_partition(struct fdisk_context *cxt, int partnum)
sgi_set_partition(cxt, partnum, 0, 0, 0);
}
-static void sgi_add_partition(struct fdisk_context *cxt, int n, int sys)
+static void sgi_add_partition(struct fdisk_context *cxt, int n,
+ struct fdisk_parttype *t)
{
char mesg[256];
unsigned int first=0, last=0;
+ int sys = t ? t->type : SGI_XFS;
- if (n == 10) {
+ if (n == 10)
sys = SGI_VOLUME;
- } else if (n == 8) {
+ else if (n == 8)
sys = 0;
- }
+
if (sgi_get_num_sectors(cxt, n)) {
printf(_("Partition %d is already defined. Delete "
"it before re-adding it.\n"), n + 1);