From 6fe03f55903194dac9a0519ddb0545986dafe5c4 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 7 Mar 2017 22:02:49 +0100 Subject: simplify using ped_disk_probe() --- perl-install/c/stuff.xs.pl | 7 +++---- 1 file 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: -- cgit v1.2.1