Browse Source

failtest: use 64 bit offsets if available.

We have to be consistent with the caller, so turn on 64 bit offsets if
available for both the caller and us.
Rusty Russell 14 years ago
parent
commit
0a379f7736
3 changed files with 7 additions and 2 deletions
  1. 1 2
      ccan/failtest/failtest.c
  2. 3 0
      ccan/failtest/failtest.h
  3. 3 0
      ccan/failtest/failtest_override.h

+ 1 - 2
ccan/failtest/failtest.c

@@ -1,5 +1,5 @@
 /* Licensed under LGPL - see LICENSE file for details */
-#include "config.h"
+#include <ccan/failtest/failtest.h>
 #include <stdarg.h>
 #include <string.h>
 #include <stdio.h>
@@ -17,7 +17,6 @@
 #include <assert.h>
 #include <ccan/read_write_all/read_write_all.h>
 #include <ccan/failtest/failtest_proto.h>
-#include <ccan/failtest/failtest.h>
 #include <ccan/build_assert/build_assert.h>
 
 enum failtest_result (*failtest_hook)(struct failtest_call *, unsigned);

+ 3 - 0
ccan/failtest/failtest.h

@@ -2,6 +2,9 @@
 #ifndef CCAN_FAILTEST_H
 #define CCAN_FAILTEST_H
 #include "config.h"
+#if HAVE_FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 #include <sys/types.h>
 #include <stdbool.h>
 #include <fcntl.h>

+ 3 - 0
ccan/failtest/failtest_override.h

@@ -3,6 +3,9 @@
 #define CCAN_FAILTEST_OVERRIDE_H
 /* This file is included before the source file to test. */
 #include "config.h"
+#if HAVE_FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
 
 /* Replacement of allocators. */
 #include <stdlib.h>