[gparted] Ensure kpartx is executed even if dmraid fails



commit 3f773c3ae8be1e85fd39f8e5745244a46667ac25
Author: Curtis Gedak <gedakc gmail com>
Date:   Wed Apr 29 16:23:28 2009 -0600

    Ensure kpartx is executed even if dmraid fails
---
 src/DMRaid.cc |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/DMRaid.cc b/src/DMRaid.cc
index 0f6feec..f74c0f5 100644
--- a/src/DMRaid.cc
+++ b/src/DMRaid.cc
@@ -275,12 +275,18 @@ bool DMRaid::create_dev_map_entries( const Glib::ustring & dev_path )
 	//  Try both dmraid -ay and kpartx -a
 
 	Glib::ustring command, output, error ;
+	bool exit_status = true ;
 
 	Glib::ustring dmraid_prefix = get_dmraid_prefix( dev_path ) ;
 	Glib::ustring dmraid_name = get_dmraid_name( dev_path ) ;
 
-	command = "dmraid -ay -v " + dmraid_prefix + " && kpartx -a -v " + DEV_MAP_PATH + dmraid_name ;
-	bool exit_status = ! Utils::execute_command( command, output, error, true ) ;
+	command = "dmraid -ay -v " + dmraid_prefix ;
+	if ( Utils::execute_command( command, output, error, true ) )
+		exit_status = false;	//command failed
+
+	command = "kpartx -a -v " + DEV_MAP_PATH + dmraid_name ;
+	if ( Utils::execute_command( command, output, error, true ) )
+		exit_status = false;	//command failed
 
 	return exit_status ;
 }



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