From e9ef70cefa571bb1ada1ec515a433ed9a643a171 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Mon, 15 Aug 2011 16:26:07 +0000 Subject: Refactoring : Tout ce qui "ncurses" a été dégagé dans un "module" séparé. Le ddhardrescue.c est tout propre maintenant. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2011-ddhardrescue/trunk@21 d3078510-dda0-49f1-841c-895ef4b7ec81 --- src/recover.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/recover.c') diff --git a/src/recover.c b/src/recover.c index e6e574a..2131542 100644 --- a/src/recover.c +++ b/src/recover.c @@ -1,10 +1,10 @@ -#include -#include #include "recover.h" -// Just for sleep -#include +#include +#include +#include /* for usleep - to be removed */ +// Main algorithm for recover datas void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) { slice_t *sliceToRead; address_t firstError=0, median, foundMax=0; @@ -62,21 +62,24 @@ void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) { break; case 3: // Internal error of sliceSlpit because this set of parameters prevent split by 3 - exit(5); // TODO + exit(6); // TODO break; case -1: // Memory error - exit(4); //TODO + exit(5); //TODO break; default: // API error, all necessary cases are already listed - exit(6); // TODO + exit(7); // TODO } } } +// Method tha read source (and clone to dest) until the first read error int tryRecoverUntilError(slice_t *sliceToRead, address_t *firstError, char *src, char *dst, char*ddOpts) { //TODO : implement realy that + //TODO : bail out hardly if WRITE error (on dest) + // char ddinvocation[256]; int res; address_t seek, count; @@ -117,7 +120,8 @@ int tryRecoverUntilError(slice_t *sliceToRead, address_t *firstError, char *src, *firstError=error; } - usleep(10000); + // Keep things humanly understandable (to be removed when real reads will be done) + //usleep(10000); return res; } -- cgit v1.2.3