From 47e0c00a7eef2917e8dcf5688e4853e7707ab09c Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Tue, 25 Oct 2011 11:45:36 -0600 Subject: [PATCH] Handle additional return codes from btrfsctl resizing Sometimes btrfsctl returns 256 on successful resize, not just 0. --- src/btrfs.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btrfs.cc b/src/btrfs.cc index 16eb0896..f7aede5a 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 ;