Permalink
Browse files

scan .hint (not QuickLZ compressed)

  • Loading branch information...
1 parent 4704fcb commit 6348abf6ae454a7af973bc271c1fea8a4809e381 @davies davies committed Apr 30, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/bitcask.c
View
@@ -106,8 +106,13 @@ void bc_scan(Bitcask* bc)
if (0 == stat(hintpath, &st)){
scanHintFile(bc->tree, i, hintpath, NULL);
}else{
- sprintf(hintpath, "%s/%s", mgr_alloc(bc->mgr, hname), hname);
- scanDataFile(bc->tree, i, datapath, hintpath);
+ hintpath[strlen(hintpath)-4] = '\0'; // drop ".qlz"
+ if (0 == stat(hintpath, &st)){
+ scanHintFile(bc->tree, i, hintpath, NULL);
+ }else{
+ sprintf(hintpath, "%s/%s", mgr_alloc(bc->mgr, hname), hname);
+ scanDataFile(bc->tree, i, datapath, hintpath);
+ }
}
}else{
if (0 == stat(hintpath, &st) &&

0 comments on commit 6348abf

Please sign in to comment.