From: Pádraig Brady
Date: Thu, 13 Jan 2011 09:36:38 +0000 (+0000)
Subject: maint: trivial system header file cleanups
X-Git-Tag: v8.10~71
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=v8.9-10-ge1aaf89;p=thirdparty%2Fcoreutils.git
maint: trivial system header file cleanups
* src/system.h: Note where it should be included, and
make ordering check portable to GLIBC > 2
* src/copy.c: Move along with other system headers
as is done elsewhere.
* src/install.c: Move along with other system headers
as is done elsewhere.
* src/ptx.c: Include rather than "regex.h" as
is done elsewhere. Note is kept after "system.h"
as per commit dba300a0.
---
diff --git a/src/copy.c b/src/copy.c
index a160952bb1..9a014ad5aa 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
#include
@@ -61,8 +62,6 @@
# include "verror.h"
#endif
-#include
-
#ifndef HAVE_FCHOWN
# define HAVE_FCHOWN false
# define fchown(fd, uid, gid) (-1)
diff --git a/src/install.c b/src/install.c
index c34e4dcd91..cebb64278f 100644
--- a/src/install.c
+++ b/src/install.c
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include "system.h"
#include "backupfile.h"
@@ -48,8 +49,6 @@
#define AUTHORS proper_name ("David MacKenzie")
-#include
-
static int selinux_enabled = 0;
static bool use_default_selinux_context = true;
diff --git a/src/ptx.c b/src/ptx.c
index 940f6e84e7..6465618421 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -22,13 +22,13 @@
#include
#include
#include "system.h"
+#include
#include "argmatch.h"
#include "diacrit.h"
#include "error.h"
#include "fadvise.h"
#include "quote.h"
#include "quotearg.h"
-#include "regex.h"
#include "stdio--.h"
#include "xstrtol.h"
diff --git a/src/system.h b/src/system.h
index 3b32cbd6c4..b86e570470 100644
--- a/src/system.h
+++ b/src/system.h
@@ -14,11 +14,15 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
+/* Include this file _after_ system headers if possible. */
+
#include
-/* Include sys/types.h before this file. */
+/* Include before this file.
+ Note this doesn't warn if we're included
+ before all system headers. */
-#if 2 <= __GLIBC__ && 2 <= __GLIBC_MINOR__
+#if 2 < __GLIBC__ || ( 2 == ___GLIBC__ && 2 <= __GLIBC_MINOR__ )
# if ! defined _SYS_TYPES_H
you must include before including this file
# endif