From 62eb359ca0f1e65e0e0c94f8549de9dfc249e9f2 Mon Sep 17 00:00:00 2001 From: Barry Perlman Date: Tue, 16 Apr 2013 23:59:33 -0400 Subject: [PATCH] [t:2892] Fix error in toku_get_version_of_logs_on_disk() so version_found is always set correctly. git-svn-id: file:///svn/toku/tokudb@26350 c7de825b-a66e-492c-adef-691d508d4ae1 --- newbrt/logger.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/newbrt/logger.c b/newbrt/logger.c index 40fd80e3fab..8561b25f116 100644 --- a/newbrt/logger.c +++ b/newbrt/logger.c @@ -1388,11 +1388,12 @@ toku_get_version_of_logs_on_disk(const char *log_dir, BOOL *found_any_logs, uint uint64_t this_log_number; BOOL is_log = is_a_logfile_any_version(de->d_name, &this_log_number, &this_log_version); if (is_log) { - if (found) { - highest_version = highest_version > this_log_version ? highest_version : this_log_version; + if (!found) { // first log file found + found = TRUE; + highest_version = this_log_version; } - found = TRUE; - highest_version = this_log_version; + else + highest_version = highest_version > this_log_version ? highest_version : this_log_version; } } }