summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-03-07 22:02:49 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-03-14 22:22:31 +0000
commit6fe03f55903194dac9a0519ddb0545986dafe5c4 (patch)
tree518ecd878d9d3561477c00b55f15a5a4ac0f4338
parent299738fd1af3a9d854e00a2c3a4e743cf6ec15f4 (diff)
downloaddrakx-6fe03f55903194dac9a0519ddb0545986dafe5c4.tar
drakx-6fe03f55903194dac9a0519ddb0545986dafe5c4.tar.gz
drakx-6fe03f55903194dac9a0519ddb0545986dafe5c4.tar.bz2
drakx-6fe03f55903194dac9a0519ddb0545986dafe5c4.tar.xz
drakx-6fe03f55903194dac9a0519ddb0545986dafe5c4.zip
simplify using ped_disk_probe()
-rwxr-xr-xperl-install/c/stuff.xs.pl7
1 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl
index f54a8689b..c8dc6130c 100755
--- a/perl-install/c/stuff.xs.pl
+++ b/perl-install/c/stuff.xs.pl
@@ -641,10 +641,9 @@ get_disk_type(char * device_path)
PedDevice *dev = ped_device_get(device_path);
RETVAL = NULL;
if(dev) {
- PedDisk* disk = ped_disk_new(dev);
- if(disk) {
- RETVAL = disk->type->name;
- ped_disk_destroy(disk);
+ PedDiskType* type = ped_disk_probe(dev);
+ if(type) {
+ RETVAL = type->name;
}
}
OUTPUT: