diff --git a/ChangeLog b/ChangeLog index ba8e4d8f..0a307369 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-03-23 Curtis Gedak + * src/linux_swap.cc: Maintained label and uuid when resizing swap. + - Closes GParted bug #575585 + * src/DMRaid.cc: Fixed error when resizing an extended partition. 2009-03-16 Curtis Gedak diff --git a/src/linux_swap.cc b/src/linux_swap.cc index 55a69609..633d0470 100644 --- a/src/linux_swap.cc +++ b/src/linux_swap.cc @@ -77,16 +77,13 @@ bool linux_swap::resize( const Partition & partition_new, OperationDetail & oper /*TO TRANSLATORS: looks like create new linux-swap file system */ operationdetail .add_child( OperationDetail( String::ucompose( _("create new %1 file system"), Utils::get_filesystem_string( FS_LINUX_SWAP ) ) ) ) ; - if ( create( partition_new, operationdetail .get_last_child() ) ) - { - operationdetail .get_last_child() .set_status( STATUS_SUCCES ) ; - return true ; - } - else - { - operationdetail .get_last_child() .set_status( STATUS_ERROR ) ; - return false ; - } + + //Maintain label and uuid when recreating swap + Glib::ustring command = "mkswap -L \"" + partition_new .label + "\" -U \"" + partition_new .uuid + "\" " + partition_new .get_path() ; + bool exit_status = ! execute_command( command , operationdetail .get_last_child() ) ; + + operationdetail .get_last_child() .set_status( exit_status ? STATUS_SUCCES : STATUS_ERROR ) ; + return exit_status ; } bool linux_swap::copy( const Glib::ustring & src_part_path,