summaryrefslogtreecommitdiff
path: root/src/recover.c
diff options
context:
space:
mode:
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;
}