From 65c5348f797c88ffca7591fa16eeeb6ec56a679f Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 8 Mar 2009 05:28:52 +0000 Subject: Merge r529 from libarchive.googlecode.com: Fix how we read ext2fs_fs.h headers on Linux. --- usr.bin/tar/write.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'usr.bin/tar') diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c index 682a3e5..b64de18 100644 --- a/usr.bin/tar/write.c +++ b/usr.bin/tar/write.c @@ -44,10 +44,6 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_ERRNO_H #include #endif -#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__) -/* This header exists but is broken on Cygwin. */ -#include -#endif #ifdef HAVE_FCNTL_H #include #endif @@ -63,6 +59,17 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_LINUX_FS_H #include /* for Linux file flags */ #endif +/* + * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h. + * As the include guards don't agree, the order of include is important. + */ +#ifdef HAVE_LINUX_EXT2_FS_H +#include /* for Linux file flags */ +#endif +#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__) +/* This header exists but is broken on Cygwin. */ +#include +#endif #ifdef HAVE_PWD_H #include #endif -- cgit v1.1