Commit a52be1bd authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Candidate fix for #1305 (no test case written yet, so it isn't fixed.) Addresses #1305.

git-svn-id: file:///svn/toku/tokudb.1032b@8250 c7de825b-a66e-492c-adef-691d508d4ae1
parent 71686cba
...@@ -43,7 +43,7 @@ ssize_t bread_backwards(BREAD br, void *vbuf, size_t nbytes) { ...@@ -43,7 +43,7 @@ ssize_t bread_backwards(BREAD br, void *vbuf, size_t nbytes) {
} }
if (nbytes>0) { if (nbytes>0) {
assert(br->bufoff==0); assert(br->bufoff==0);
size_t to_read = ((size_t)br->current_offset >= br->bufsize) ? br->bufsize : (size_t)br->current_offset; size_t to_read = ((u_int64_t)br->current_offset >= (u_int64_t)br->bufsize) ? br->bufsize : (size_t)br->current_offset;
ssize_t r = pread(br->fd, br->buf, to_read, br->current_offset-to_read); ssize_t r = pread(br->fd, br->buf, to_read, br->current_offset-to_read);
assert(r==(ssize_t)to_read); assert(r==(ssize_t)to_read);
br->bufoff = to_read; br->bufoff = to_read;
......
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