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

Candidate fix for #1308 (part a). Addresses #1308.

git-svn-id: file:///svn/toku/tokudb.1032b@8279 c7de825b-a66e-492c-adef-691d508d4ae1
parent 60366c24
...@@ -33,7 +33,7 @@ maybe_preallocate_in_file (int fd, u_int64_t size) ...@@ -33,7 +33,7 @@ maybe_preallocate_in_file (int fd, u_int64_t size)
assert(r==0); assert(r==0);
} }
assert(file_size >= 0); assert(file_size >= 0);
if ((size_t)file_size < size) { if ((u_int64_t)file_size < size) {
const int N = umin64(size, 16<<20); // Double the size of the file, or add 16MB, whichever is less. const int N = umin64(size, 16<<20); // Double the size of the file, or add 16MB, whichever is less.
char *MALLOC_N(N, wbuf); char *MALLOC_N(N, wbuf);
memset(wbuf, 0, N); memset(wbuf, 0, N);
......
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