diff options
author | Karel Zak | 2012-09-26 14:14:54 +0200 |
---|---|---|
committer | Karel Zak | 2012-09-27 13:38:13 +0200 |
commit | ed470672bbbfeb160008cecb28c2a443e755d289 (patch) | |
tree | 4ad124f5ac82f45fd1944e2d3f0bb81cea77de90 /fdisks/fdisksgilabel.c | |
parent | fdisk: add fdisk_set_partition_type() (diff) | |
download | kernel-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.c | 10 |
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); |