summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2010-01-09 21:18:06 +0100
committerJim Meyering <meyering@redhat.com>2010-01-12 06:31:20 +0100
commit6454dd0f2f792850453379ba081ca74eed15c2d9 (patch)
tree2ae40582021bd9c37f6060acb91bfc518a43f250
parentd0f18197fcd9803bc73c3c2bb37c70ef5c3f45dc (diff)
downloadcoreutils-6454dd0f2f792850453379ba081ca74eed15c2d9.tar.xz
ls: reorder includes to work around broken <sys/capability.h>
* 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.
-rw-r--r--NEWS5
-rw-r--r--src/ls.c11
2 files changed, 12 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 3b382e936..04a75cd6f 100644
--- 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]
diff --git a/src/ls.c b/src/ls.c
index aa601fdc2..9ef7eba21 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -39,10 +39,6 @@
#include <config.h>
#include <sys/types.h>
-#ifdef HAVE_CAP
-# include <sys/capability.h>
-#endif
-
#if HAVE_TERMIOS_H
# include <termios.h>
#endif
@@ -113,6 +109,13 @@
#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"))