Move sys/mman.h include out of system.h to the places that care
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Jan 2010 10:14:37 +0000 (12:14 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 5 Jan 2010 10:16:52 +0000 (12:16 +0200)
- just two places where needed, dont pollute system.h needlessly
- include depending on HAVE_MMAP instead of separately checking for
  sys/mman.h, if sys/mman.h doesn't exist or is broken HAVE_MMAP wont be set

configure.ac
lib/fsm.c
rpmio/rpmfileutil.c
system.h

index 9b83e5a..bf53a75 100644 (file)
@@ -358,7 +358,7 @@ AC_CHECK_HEADERS(limits.h)
 AC_CHECK_HEADERS(fcntl.h getopt.h memory.h)
 
 AC_CHECK_HEADERS(sys/ipc.h)
-AC_CHECK_HEADERS(sys/mman.h sys/utsname.h sys/wait.h)
+AC_CHECK_HEADERS(sys/utsname.h sys/wait.h)
 
 AC_CHECK_HEADERS(mntent.h sys/mnttab.h sys/systemcfg.h)
 AC_CHECK_HEADERS(sys/mount.h sys/mntctl.h sys/param.h sys/vmount.h)
index 3bddbc9..fc972a0 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -6,6 +6,10 @@
 #include "system.h"
 
 #include <utime.h>
+#if defined(HAVE_MMAP)
+#include <sys/mman.h>
+#endif
+
 #include <rpm/rpmte.h>
 #include <rpm/rpmts.h>
 #include <rpm/rpmsq.h>
index 454d8e3..9252443 100644 (file)
 
 #endif
 
+#if defined(HAVE_MMAP)
+#include <sys/mman.h>
+#endif
+
 #include <popt.h>
 
 #include <rpm/rpmfileutil.h>
index bbdcb48..8e9d744 100644 (file)
--- a/system.h
+++ b/system.h
@@ -97,10 +97,6 @@ char *getenv (const char *name);
 
 #include <ctype.h>
 
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
 #if HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif