From 505d215e912a02e74a5247994e3eb2645a423256 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 10 Dec 2015 18:57:27 +0000 Subject: [PATCH] Fix page_flush, use off_t correctly --- libraries/liblmdb/Makefile | 2 +- libraries/liblmdb/mdb.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile index fa469a2..5ddef85 100644 --- a/libraries/liblmdb/Makefile +++ b/libraries/liblmdb/Makefile @@ -23,7 +23,7 @@ AR = ar W = -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized THREADS = -pthread OPT = -O2 -g -XCFLAGS = -DMDB_VL32 +XCFLAGS = -DMDB_VL32 -D_FILE_OFFSET_BITS=64 CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) LDLIBS = # -lntdll # Windows needs ntdll SOLIBS = # -lntdll diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 9ab7b29..026037c 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3410,15 +3410,16 @@ mdb_page_flush(MDB_txn *txn, int keep) MDB_ID2L dl = txn->mt_u.dirty_list; unsigned psize = env->me_psize, j; int i, pagecount = dl[0].mid, rc; - size_t size = 0, pos = 0; + size_t size = 0; + off_t pos = 0; pgno_t pgno = 0; MDB_page *dp = NULL; #ifdef _WIN32 OVERLAPPED ov; #else struct iovec iov[MDB_COMMIT_PAGES]; - ssize_t wpos = 0, wsize = 0, wres; - size_t next_pos = 1; /* impossible pos, so pos != next_pos */ + ssize_t wsize = 0, wres; + off_t wpos = 0, next_pos = 1; /* impossible pos, so pos != next_pos */ int n = 0; #endif