summaryrefslogtreecommitdiff
path: root/src/recover.c
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2011-08-14 20:55:21 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2011-08-14 20:55:21 +0000
commit4dffa2530b6aedc5ac4910d3dead3930b4293c12 (patch)
tree8d6e48e561bd5fb4b110a745f26f45ab7f7a4281 /src/recover.c
parentc908d810330edba56b476229aba081997f251da7 (diff)
download2011-ddhardrescue-4dffa2530b6aedc5ac4910d3dead3930b4293c12.tar.gz
2011-ddhardrescue-4dffa2530b6aedc5ac4910d3dead3930b4293c12.tar.bz2
2011-ddhardrescue-4dffa2530b6aedc5ac4910d3dead3930b4293c12.zip
Ajout d'un usleep dans tryToRecover... histoire d'arriver à voir que le graphique évolue. Bon, prochaine étape, la gestion du resizing de fenetre ? Ya la gestion du zoom à faire aussi.
git-svn-id: file:///var/svn/2011-ddhardrescue/trunk@19 d3078510-dda0-49f1-841c-895ef4b7ec81
Diffstat (limited to 'src/recover.c')
-rw-r--r--src/recover.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/recover.c b/src/recover.c
index 8d47853..e6e574a 100644
--- a/src/recover.c
+++ b/src/recover.c
@@ -2,6 +2,9 @@
#include <stdio.h>
#include "recover.h"
+// Just for sleep
+#include <unistd.h>
+
void recover(slices_evt_t *slicesEvt, char *src, char *dst, char *ddOpts) {
slice_t *sliceToRead;
address_t firstError=0, median, foundMax=0;
@@ -105,7 +108,8 @@ int tryRecoverUntilError(slice_t *sliceToRead, address_t *firstError, char *src,
*/
// Simulate for each read a pseudo random error position and generate some cases of full read without error
- address_t error=sliceToRead->begin + rand()%count;
+ //address_t error=sliceToRead->begin + rand()%(count);
+ address_t error=sliceToRead->begin + rand()%(count/3);
if ( error % 42 == 0 ) {
res=0;
} else {
@@ -113,6 +117,7 @@ int tryRecoverUntilError(slice_t *sliceToRead, address_t *firstError, char *src,
*firstError=error;
}
+ usleep(10000);
return res;
}