From e8eebe0fbc3c3c946380a1c554bc1214ae899663 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 14 Sep 2011 07:06:13 +0930 Subject: tdb2: Fix to always use 64-bit offset definition We use off_t in the tdb2 interface (for tdb_attribute_flock); we need to make sure that all callers agree on the size. This also causes a problem in the tests: it's not enough to include config.h first, we need the _FILE_OFFSET_BITS define from private.h. Otherwise, we can disagree about the definitions of F_SETLK, F_SETLKW and off_t, causing strange problems. (Imported from CCAN commit baa17ee2d5e01a32030f19e566007417d72b4b6e) Signed-off-by: Rusty Russell --- lib/tdb2/tdb2.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/tdb2/tdb2.h') diff --git a/lib/tdb2/tdb2.h b/lib/tdb2/tdb2.h index 3f80793d76..93f8e9d3cb 100644 --- a/lib/tdb2/tdb2.h +++ b/lib/tdb2/tdb2.h @@ -30,6 +30,10 @@ extern "C" { #endif #ifndef _SAMBA_BUILD_ +#include "config.h" +#if HAVE_FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif /* For mode_t */ #include /* For O_* flags. */ -- cgit