1 From f0256fb16d37061e04ca966da9d51d8eb205bc89 Mon Sep 17 00:00:00 2001
2 From: Denys Vlasenko <vda.linux@googlemail.com>
3 Date: Tue, 26 Jul 2011 11:42:12 +0000
4 Subject: *: work around sysinfo.h versus linux/*.h problems
6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
8 include/libbb.h | 10 ++++++----
12 procps/uptime.c | 4 ++++
13 5 files changed, 18 insertions(+), 5 deletions(-)
15 diff --git a/include/libbb.h b/include/libbb.h
16 index afe3b61..9fcd770 100644
20 #ifdef HAVE_SYS_STATFS_H
21 # include <sys/statfs.h>
23 -/* struct sysinfo is linux-specific */
25 -# include <sys/sysinfo.h>
27 +/* Don't do this here:
28 + * #include <sys/sysinfo.h>
29 + * Some linux/ includes pull in conflicting definition
30 + * of struct sysinfo (only in some toolchanins), which breaks build.
31 + * Include sys/sysinfo.h only in those files which need it.
34 # include <selinux/selinux.h>
35 # include <selinux/context.h>
36 diff --git a/init/init.c b/init/init.c
37 index 0a0d503..5121b94 100644
42 #include <sys/resource.h>
44 -#include <linux/vt.h>
45 +# include <linux/vt.h>
46 +# include <sys/sysinfo.h>
48 #if ENABLE_FEATURE_UTMP
49 # include <utmp.h> /* DEAD_PROCESS */
50 diff --git a/procps/free.c b/procps/free.c
51 index efbac5b..706be1b 100644
55 /* getopt not needed */
59 +# include <sys/sysinfo.h>
64 diff --git a/procps/ps.c b/procps/ps.c
65 index 48b55a7..e9e6ca9 100644
68 @@ -16,6 +16,9 @@ enum { MAX_WIDTH = 2*1024 };
73 +# include <sys/sysinfo.h>
75 #include <sys/times.h> /* for times() */
78 diff --git a/procps/uptime.c b/procps/uptime.c
79 index 5c48795..eda782c 100644
83 /* getopt not needed */
87 +# include <sys/sysinfo.h>
92 # define FSHIFT 16 /* nr of bits of precision */