From 9010255c1cd90ac4e1f5baf1b11c76b56dc61b91 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Sat, 9 Sep 2006 11:11:32 +0000 Subject: [PATCH] return true if filesystem was succesfully modified by dosfsck. * src/fat16.cc, src/fat32.cc: return true if filesystem was succesfully modified by dosfsck. --- ChangeLog | 6 ++++++ src/fat16.cc | 4 ++-- src/fat32.cc | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a5bf82b..0e02ecd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-09 Bart Hakvoort + + * src/fat16.cc, + src/fat32.cc: return true if filesystem was succesfully modified by + dosfsck. + 2006-09-09 Bart Hakvoort * include/Dialog_Progress.h, diff --git a/src/fat16.cc b/src/fat16.cc index ab67c1d8..f380b3ff 100644 --- a/src/fat16.cc +++ b/src/fat16.cc @@ -52,7 +52,7 @@ FS fat16::get_filesystem_support() void fat16::set_used_sectors( Partition & partition ) { exit_status = Utils::execute_command( "dosfsck -a -v " + partition .get_path(), output, error, true ) ; - if ( exit_status == 0 || exit_status == 1 ) + if ( exit_status == 0 || exit_status == 1 || exit_status == 256 ) { //free clusters index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ; @@ -100,7 +100,7 @@ bool fat16::check_repair( const Partition & partition, OperationDetail & operati { exit_status = execute_command( "dosfsck -a -w -v " + partition .get_path(), operationdetail ) ; - return ( exit_status == 0 || exit_status == 1 ) ; + return ( exit_status == 0 || exit_status == 1 || exit_status == 256 ) ; } } //GParted diff --git a/src/fat32.cc b/src/fat32.cc index ca1965d7..5675abf2 100644 --- a/src/fat32.cc +++ b/src/fat32.cc @@ -52,7 +52,7 @@ void fat32::set_used_sectors( Partition & partition ) { //FIXME: i've encoutered a readonly fat32 filesystem.. this won't work with the -a ... best check also without the -a exit_status = Utils::execute_command( "dosfsck -a -v " + partition .get_path(), output, error, true ) ; - if ( exit_status == 0 || exit_status == 1 ) + if ( exit_status == 0 || exit_status == 1 || exit_status == 256 ) { //free clusters index = output .find( ",", output .find( partition .get_path() ) + partition .get_path() .length() ) +1 ; @@ -100,7 +100,7 @@ bool fat32::check_repair( const Partition & partition, OperationDetail & operati { exit_status = execute_command( "dosfsck -a -w -v " + partition .get_path(), operationdetail ) ; - return ( exit_status == 0 || exit_status == 1 ) ; + return ( exit_status == 0 || exit_status == 1 || exit_status == 256 ) ; } } //GParted