From d030908bfc424d492c10e6da94ae938e252093ef Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 1 Jan 2016 20:12:22 -0500 Subject: [PATCH] ext2fs: work around FreeBSD header breakage FreeBSD 10.2 will blow up compiling its own header files in sys/file.h if _XOPEN_SOURCE is defined. In file included from tdb.c:59: /usr/include/sys/file.h:209:2: error: unknown type name 'u_int' u_int xf_flag; /* flags (see fcntl.h) */ ^ 1 error generated. This is despite the fact that POSIX.1 requires comforming applications to define _XOPEN_SOURCE (to different numbers depending on the version of POSIX.1 the program is expecting to work against). See section 2.2.1 in POSIX.1 for chapter and verse. Work around this by removing the _XOPEN_SOURCE declaration. This will cause compiler warnings (and will cause builds against some versions of Solaris to break), so only do this for FreeBSD. Signed-off-by: Theodore Ts'o --- lib/ext2fs/tdb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ext2fs/tdb.c b/lib/ext2fs/tdb.c index 61e30ed..b313f3a 100644 --- a/lib/ext2fs/tdb.c +++ b/lib/ext2fs/tdb.c @@ -36,7 +36,9 @@ Last Changed Date: 2007-06-22 13:36:10 -0400 (Fri, 22 Jun 2007) #define HAVE_UTIME_H #define HAVE_UTIME #endif +#ifndef __FreeBSD__ #define _XOPEN_SOURCE 600 +#endif #include "config.h" #include -- 1.8.3.1