From bbff867267725e5d02e54c78cfadca85364208a6 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Mon, 23 Mar 2009 20:01:03 +0000 Subject: [PATCH] Maintained label and uuid when resizing swap svn path=/trunk/; revision=1105 --- ChangeLog | 3 +++ src/linux_swap.cc | 17 +++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) 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,