From 406e8dd434a62120b390b8b6dcf54c73fb561856 Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Mon, 13 Oct 2008 16:32:54 -0500 Subject: [svn-r15857] Purpose: Bug fix Description: The pre-parse of the journal file to determine maximum entry size (to determine proper memory allocation amount) didn't take into account incomplete entries at the end of the file. Modified to only parse up through the last complete entry, rather than the entire file. Tested: kagiso --- tools/h5recover/h5recover.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/h5recover/h5recover.c b/tools/h5recover/h5recover.c index bf6c1b7..b3c0de5 100644 --- a/tools/h5recover/h5recover.c +++ b/tools/h5recover/h5recover.c @@ -489,6 +489,7 @@ main (int argc, const char *argv[]) if ( fgetc(journal_fp) == '3' ) { last_trans_found = 1; + pos_end = ftell(journal_fp); fseek(journal_fp, -1, SEEK_CUR); fgets(last_trans_msg, 50, journal_fp); @@ -517,9 +518,6 @@ main (int argc, const char *argv[]) /* - max EOA size (for superblock update, to preserve raw data) */ /* ================================================================= */ - fseek(journal_fp, 0, SEEK_END); - pos_end = ftell(journal_fp); - fseek(journal_fp, 0, SEEK_SET); c_new = 0; -- cgit v0.12