From 488063371bf33e49ce472e0ec2e26cc8551ad53c Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Thu, 15 Dec 2005 15:42:09 +0000 Subject: [PATCH] don't wait for node to appear when an extended partition is created. * src/GParted_Core.cc: don't wait for node to appear when an extended partition is created. --- ChangeLog | 5 +++++ src/GParted_Core.cc | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d47e34b..9b7892e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-15 Bart Hakvoort + + * src/GParted_Core.cc: don't wait for node to appear when an extended + partition is created. + 2005-12-15 Bart Hakvoort * include/Utils.h, diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 869ec621..5712215f 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -731,9 +731,6 @@ int GParted_Core::Create_Empty_Partition( Partition & new_partition, bool copy ) { new_partition .partition = ped_partition_get_path( c_part ) ; new_partition .partition_number = c_part ->num ; - - if ( ! wait_for_node( new_partition .partition ) ) - return 0 ; } ped_constraint_destroy( constraint ); @@ -744,11 +741,16 @@ int GParted_Core::Create_Empty_Partition( Partition & new_partition, bool copy ) close_device_and_disk( ) ; } - //remove all filesystem signatures... - if ( new_partition .partition_number > 0 ) - erase_filesystem_signatures( new_partition ) ; - - return new_partition .partition_number ; + if ( new_partition .type == GParted::TYPE_EXTENDED || + ( + new_partition .partition_number > 0 && + wait_for_node( new_partition .partition ) && + erase_filesystem_signatures( new_partition ) + ) + ) + return new_partition .partition_number ; + else + return 0 ; } bool GParted_Core::Resize_Container_Partition( const Partition & partition_old, const Partition & partition_new, bool fixed_start )