[gparted] Handle additional return codes from btrfsctl resizing



commit 47e0c00a7eef2917e8dcf5688e4853e7707ab09c
Author: Curtis Gedak <gedakc gmail com>
Date:   Tue Oct 25 11:45:36 2011 -0600

    Handle additional return codes from btrfsctl resizing
    
    Sometimes btrfsctl returns 256 on successful resize, not just 0.

 src/btrfs.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/btrfs.cc b/src/btrfs.cc
index 16eb089..f7aede5 100644
--- a/src/btrfs.cc
+++ b/src/btrfs.cc
@@ -137,8 +137,6 @@ bool btrfs::copy( const Glib::ustring & src_part_path,
 
 bool btrfs::resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition )
 {
-	bool exit_status = false ;
-
 	//Create directory
 	Glib::ustring str_temp = _( "create temporary directory" ) ;
 	operationdetail .add_child( OperationDetail( str_temp, STATUS_NONE, FONT_BOLD_ITALIC ) ) ;
@@ -175,6 +173,8 @@ bool btrfs::resize( const Partition & partition_new, OperationDetail & operation
 
 		//Execute the command
 		exit_status = execute_command( str_temp, operationdetail ) ;
+		//Sometimes btrfsctl returns an exit status of 256 on successful resize.
+		exit_status = ( exit_status == 0 || exit_status == 256 ) ;
 
 		//Always unmount the file system
 		str_temp = "umount -v " + dname ;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]