]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
ls: reorder includes to work around broken <sys/capability.h>
authorKamil Dudka <kdudka@redhat.com>
Sat, 9 Jan 2010 20:18:06 +0000 (21:18 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 12 Jan 2010 05:31:20 +0000 (06:31 +0100)
* src/ls.c: Include <sys/capability.h> later, to avoid build
failure with a header from libcap-2.16-1 or earlier.
See http://bugzilla.redhat.com/483548 for details.

NEWS
src/ls.c

diff --git a/NEWS b/NEWS
index 3b382e93620cd9dcfe3289f078905053856677d0..04a75cd6f470580778e4adb57a0a3fe505ba8f2b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Build-related
+
+  Work around a build failure when using buggy <sys/capability.h>.
+  Alternatively, configure with --disable-libcap.
+
 
 * Noteworthy changes in release 8.3 (2010-01-07) [stable]
 
index aa601fdc2b8874bcf97e590451bc4893e625ba57..9ef7eba21bf205aba271c0724efe7aacde700f65 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
 #include <config.h>
 #include <sys/types.h>
 
-#ifdef HAVE_CAP
-# include <sys/capability.h>
-#endif
-
 #if HAVE_TERMIOS_H
 # include <termios.h>
 #endif
 #include "areadlink.h"
 #include "mbsalign.h"
 
+/* Include <sys/capability.h> last to avoid a clash of <sys/types.h>
+   include guards with some premature versions of libcap.
+   For more details, see <http://bugzilla.redhat.com/483548>.  */
+#ifdef HAVE_CAP
+# include <sys/capability.h>
+#endif
+
 #define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \
                       : (ls_mode == LS_MULTI_COL \
                          ? "dir" : "vdir"))