Remove non-existent or invalid devices from those named (#756434)
A non-existent or invalid disk device named on the command line caused two libparted dialogs to be displayed repeatedly on every refresh. This was because the device was only removed from the 'device_paths' vector when it wasn't usable [1]; not when it didn't exist or was invalid, when the libparted ped_device_get() call failed. Fix this. [1] Usable device as implemented by useable_device() Must not have a large sector size when GParted is built with an old version of libparted which doesn't support large sector sizes and must be able to read the first sector. Bug 756434 - GParted dumps core when passing non-existent or invalid device on the command line
This commit is contained in:
parent
663807802f
commit
bbf1a19cec
|
@ -252,11 +252,10 @@ void GParted_Core::set_devices_thread( std::vector<Device> * pdevices )
|
|||
#endif
|
||||
|
||||
PedDevice* lp_device = ped_device_get( device_paths[t].c_str() );
|
||||
if ( lp_device )
|
||||
if ( lp_device == NULL || ! useable_device( lp_device ) )
|
||||
{
|
||||
if ( ! useable_device( lp_device ) )
|
||||
// Remove this disk device which isn't useable
|
||||
device_paths.erase( device_paths.begin() + t );
|
||||
// Remove this disk device which isn't useable
|
||||
device_paths.erase( device_paths.begin() + t );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue