Commit 18fe5ef0 authored by Rusty Russell's avatar Rusty Russell

tdb2: fix msync() arg

PAGESIZE used to be defined to getpagesize(); we changed it to a
constant in b556ef1f, which broke the msync() call.
parent 71d8cfb6
...@@ -438,7 +438,7 @@ static enum TDB_ERROR transaction_sync(struct tdb_context *tdb, ...@@ -438,7 +438,7 @@ static enum TDB_ERROR transaction_sync(struct tdb_context *tdb,
} }
#ifdef MS_SYNC #ifdef MS_SYNC
if (tdb->file->map_ptr) { if (tdb->file->map_ptr) {
tdb_off_t moffset = offset & ~(PAGESIZE-1); tdb_off_t moffset = offset & ~(getpagesize()-1);
if (msync(moffset + (char *)tdb->file->map_ptr, if (msync(moffset + (char *)tdb->file->map_ptr,
length + (offset - moffset), MS_SYNC) != 0) { length + (offset - moffset), MS_SYNC) != 0) {
return tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR, return tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR,
......
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