Skip reading existing partition table before creating a new one (#743181)

Creating a new partition table was getting libparted to read any
existing partition table before creating a new partition table on the
device.  This is an unnecessary step, and if the device didn't already
contain a partition table also printed this error from libparted:

    /dev/sdb: unrecognised disk label

Since get_device_and_disk() has been split into two, just call
get_device() instead to just populate the PedDevice object representing
the disk device.  Removes a small unnecessary step.

Bug 743181 - Add unpartitioned drive read-write support
This commit is contained in:
Mike Fleetwood 2015-02-22 08:47:53 +00:00 committed by Curtis Gedak
parent 63f701033e
commit e9a5cf2843
1 changed files with 1 additions and 1 deletions

View File

@ -808,7 +808,7 @@ bool GParted_Core::set_disklabel( const Glib::ustring & device_path, const Glib:
PedDevice* lp_device = NULL ;
PedDisk* lp_disk = NULL ;
if ( get_device_and_disk( device_path, lp_device, lp_disk, false ) )
if ( get_device( device_path, lp_device ) )
{
PedDiskType *type = NULL ;
type = ped_disk_type_get( disklabel .c_str() ) ;