summaryrefslogtreecommitdiff
authorTanguy Pruvot <tanguy.pruvot@gmail.com>2011-07-27 05:18:52 (GMT)
committer Tanguy Pruvot <tanguy.pruvot@gmail.com>2011-07-27 05:18:52 (GMT)
commitf84e95061823e166e93e16de2afa7fd12ad9c3c2 (patch)
tree3f83222a2bf227525518b7809c43c7ae49c9c8ab
parent52431c54709f3db82cabcf235e7fc7cdafc7cf4a (diff)
parent67905e2d7c6ee273b753af22fb22de0ebec918c1 (diff)
downloadbusybox-f84e95061823e166e93e16de2afa7fd12ad9c3c2.zip
busybox-f84e95061823e166e93e16de2afa7fd12ad9c3c2.tar.gz
busybox-f84e95061823e166e93e16de2afa7fd12ad9c3c2.tar.bz2
Merge branch 'busybox' into gingerbread
Diffstat
-rw-r--r--include/libbb.h10
-rw-r--r--init/init.c3
-rw-r--r--procps/free.c3
-rw-r--r--procps/ps.c3
-rw-r--r--procps/uptime.c4
5 files changed, 18 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 700b2f0..dcfc41c 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -65,10 +65,12 @@
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
-/* struct sysinfo is linux-specific */
-#ifdef __linux__
-# include <sys/sysinfo.h>
-#endif
+/* Don't do this here:
+ * #include <sys/sysinfo.h>
+ * Some linux/ includes pull in conflicting definition
+ * of struct sysinfo (only in some toolchanins), which breaks build.
+ * Include sys/sysinfo.h only in those files which need it.
+ */
#if ENABLE_SELINUX
# include <selinux/selinux.h>
# include <selinux/context.h>
diff --git a/init/init.c b/init/init.c
index ff9dc06..645f694 100644
--- a/init/init.c
+++ b/init/init.c
@@ -113,7 +113,8 @@
#include <paths.h>
#include <sys/resource.h>
#ifdef __linux__
-#include <linux/vt.h>
+# include <linux/vt.h>
+# include <sys/sysinfo.h>
#endif
#include "reboot.h" /* reboot() constants */
diff --git a/procps/free.c b/procps/free.c
index ca75313..47f2fc3 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -22,6 +22,9 @@
//usage: "Total: 386144 257128 129016\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
struct globals {
unsigned mem_unit;
diff --git a/procps/ps.c b/procps/ps.c
index 7537118..dcc0f7b 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -62,6 +62,9 @@ enum { MAX_WIDTH = 2*1024 };
#if ENABLE_DESKTOP
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
#include <sys/times.h> /* for times() */
#ifndef AT_CLKTCK
# define AT_CLKTCK 17
diff --git a/procps/uptime.c b/procps/uptime.c
index 1a7da46..7432362 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -25,6 +25,10 @@
//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
+
#ifndef FSHIFT
# define FSHIFT 16 /* nr of bits of precision */