From 18fe5ef012a96014b9e61e48616e682b4a5708a2 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 27 Apr 2011 23:00:25 +0930 Subject: [PATCH] tdb2: fix msync() arg PAGESIZE used to be defined to getpagesize(); we changed it to a constant in b556ef1f, which broke the msync() call. --- ccan/tdb2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccan/tdb2/transaction.c b/ccan/tdb2/transaction.c index 805ea094..55b7fd60 100644 --- a/ccan/tdb2/transaction.c +++ b/ccan/tdb2/transaction.c @@ -438,7 +438,7 @@ static enum TDB_ERROR transaction_sync(struct tdb_context *tdb, } #ifdef MS_SYNC 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, length + (offset - moffset), MS_SYNC) != 0) { return tdb_logerr(tdb, TDB_ERR_IO, TDB_LOG_ERROR, -- 2.39.2