From: Eric Bollengier Date: Sat, 10 May 2008 16:47:33 +0000 (+0000) Subject: ebl Update faketape driver X-Git-Tag: Release-7.0.0~4615 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1bb5291413e9fee504b8fa1dc0bfe32d771d6b61;p=bacula%2Fbacula ebl Update faketape driver Cleanup hash test code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6932 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/faketape.h b/bacula/patches/testing/faketape.h index 9fa5889915..3aea2228ba 100644 --- a/bacula/patches/testing/faketape.h +++ b/bacula/patches/testing/faketape.h @@ -65,8 +65,6 @@ private: bool inplace; /* have to seek before writing ? */ bool needEOF; /* check if last operation need eof */ - POOLMEM *volume; /* volume name */ - int32_t last_file; /* last file of the volume */ int32_t current_file; /* max 65000 files */ int32_t current_block; /* max 4G blocks of 1KB */ diff --git a/bacula/patches/testing/hash.c b/bacula/patches/testing/hash.c index cd808298d8..7a5a53844e 100644 --- a/bacula/patches/testing/hash.c +++ b/bacula/patches/testing/hash.c @@ -134,7 +134,7 @@ bool hash_put(char *key, char *val) { int ecode; - if (!tcbdbput2(hdb, key, val)) { + if (!tcbdbput(hdb, key, strlen(key), val, strlen(val)+1)) { ecode = tcbdbecode(hdb); fprintf(stderr, "put error: %s\n", tcbdberrmsg(ecode)); return 0; @@ -314,9 +314,11 @@ int main(int argc, char **argv) ctime = get_current_time(); fprintf(stderr, "elt;time\n"); while (fgets(line, sizeof(line), fp)) { + i++; + hash_put(line, data); - if (i++ == 99) { + if (i == 99) { strcpy(save_key, mkey); } @@ -347,6 +349,7 @@ int main(int argc, char **argv) char *p; fprintf(stderr, "elt;time\n"); while (fgets(line, sizeof(line), fp)) { + i++; p = hash_get(line, data, sizeof(data)); if (p) { p[5]='H'; @@ -358,7 +361,6 @@ int main(int argc, char **argv) fprintf(stderr, "%i;%i\n", i/100000, (int) ((ttime - ctime)/1000)); } - i++; hash_free(p); } @@ -370,12 +372,12 @@ int main(int argc, char **argv) hash_iterinit(); while(hash_next(line, sizeof(line), data, sizeof(data))) { + i++; if (i%100000 == 0) { ttime= get_current_time(); fprintf(stderr, "%i;%i\n", i/100000, (int) ((ttime - ctime)/1000)); } - i++; } hash_iterdone();