Commit 0955312a authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

cat the log file prior to scanning it refs[t:2432]

git-svn-id: file:///svn/toku/tokudb@18214 c7de825b-a66e-492c-adef-691d508d4ae1
parent d968f27f
......@@ -55,10 +55,23 @@ static toku_off_t lc_file_len(const char *name) {
return buf.st_size;
}
static void catfile(const char *fname, void *buffer, size_t buffer_size) {
int fd = open(fname, O_RDONLY);
if (fd >= 0) {
while (1) {
ssize_t r = read(fd, buffer, buffer_size);
if ((int)r <= 0)
break;
}
}
close(fd);
}
static int lc_open_logfile(TOKULOGCURSOR lc, int index) {
int r=0;
assert( !lc->is_open );
if( index == -1 || index >= lc->n_logfiles) return DB_NOTFOUND;
catfile(lc->logfiles[index], lc->buffer, lc->buffer_size);
lc->cur_fp = fopen(lc->logfiles[index], "rb");
if ( lc->cur_fp == NULL )
return DB_NOTFOUND;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment