[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ls.c: reorder includes to work around broken <sys/capability
From: |
Jim Meyering |
Subject: |
Re: [PATCH] ls.c: reorder includes to work around broken <sys/capability.h> |
Date: |
Sat, 09 Jan 2010 22:40:08 +0100 |
Kamil Dudka wrote:
> On Saturday 09 of January 2010 21:00:56 Kamil Dudka wrote:
>> It looks to me like https://bugzilla.redhat.com/483548 - it has been
>> discussed several times on this mailing list. You can find it going through
>> the archive.
>
> As the problem still persists on some systems, it drives me to another idea.
Thanks! I'll push that.
I've added details (and "* src/ls.c: ...) to the log.
>From cd6f8e4745134f8100508b528f68683361302407 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <address@hidden>
Date: Sat, 9 Jan 2010 21:18:06 +0100
Subject: [PATCH] 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.
---
src/ls.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/ls.c b/src/ls.c
index aa601fd..9ef7eba 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"))
--
1.6.6.439.gaf68f