summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/ddhardrescue.c3
-rw-r--r--src/recover.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ddhardrescue.c b/src/ddhardrescue.c
index 691bf09..e10d323 100644
--- a/src/ddhardrescue.c
+++ b/src/ddhardrescue.c
@@ -140,11 +140,12 @@ void cursesUpdateSliceDump(slices_evt_t *slicesEvt, slice_t *modifiedSlice) {
// static int progress=0;
char *toPrint;
address_t blockSize=0;
+ unsigned int charCount=(getmaxx(winUpdateSliceDump)-getbegx(winUpdateSliceDump))*(getmaxy(winUpdateSliceDump)-getbegy(winUpdateSliceDump)+2);
//FIXME : do that realy
pthread_mutex_lock(&ncursesWriteMutex);
- toPrint=slicesDump(slicesEvt->data, &blockSize, 1000, slicesEvt->data->min, slicesEvt->data->max);
+ toPrint=slicesDump(slicesEvt->data, &blockSize, charCount, slicesEvt->data->min, slicesEvt->data->max);
if (toPrint != NULL) {
attron(COLOR_PAIR(4));
mvwprintw(winUpdateSliceDump, 1, 0, toPrint);
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;
}