aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 3d31ff225..63d041957 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -52,10 +52,12 @@
52#ifdef HAVE_SYS_STATFS_H 52#ifdef HAVE_SYS_STATFS_H
53# include <sys/statfs.h> 53# include <sys/statfs.h>
54#endif 54#endif
55/* struct sysinfo is linux-specific */ 55/* Don't do this here:
56#ifdef __linux__ 56 * #include <sys/sysinfo.h>
57# include <sys/sysinfo.h> 57 * Some linux/ includes pull in conflicting definition
58#endif 58 * of struct sysinfo (only in some toolchanins), which breaks build.
59 * Include sys/sysinfo.h only in those files which need it.
60 */
59#if ENABLE_SELINUX 61#if ENABLE_SELINUX
60# include <selinux/selinux.h> 62# include <selinux/selinux.h>
61# include <selinux/context.h> 63# include <selinux/context.h>
diff --git a/init/init.c b/init/init.c
index ff9dc06a4..645f694c0 100644
--- a/init/init.c
+++ b/init/init.c
@@ -113,7 +113,8 @@
113#include <paths.h> 113#include <paths.h>
114#include <sys/resource.h> 114#include <sys/resource.h>
115#ifdef __linux__ 115#ifdef __linux__
116#include <linux/vt.h> 116# include <linux/vt.h>
117# include <sys/sysinfo.h>
117#endif 118#endif
118#include "reboot.h" /* reboot() constants */ 119#include "reboot.h" /* reboot() constants */
119 120
diff --git a/procps/free.c b/procps/free.c
index ca753134c..47f2fc3b2 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -22,6 +22,9 @@
22//usage: "Total: 386144 257128 129016\n" 22//usage: "Total: 386144 257128 129016\n"
23 23
24#include "libbb.h" 24#include "libbb.h"
25#ifdef __linux__
26# include <sys/sysinfo.h>
27#endif
25 28
26struct globals { 29struct globals {
27 unsigned mem_unit; 30 unsigned mem_unit;
diff --git a/procps/ps.c b/procps/ps.c
index 7537118f6..dcc0f7bd4 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -62,6 +62,9 @@ enum { MAX_WIDTH = 2*1024 };
62 62
63#if ENABLE_DESKTOP 63#if ENABLE_DESKTOP
64 64
65#ifdef __linux__
66# include <sys/sysinfo.h>
67#endif
65#include <sys/times.h> /* for times() */ 68#include <sys/times.h> /* for times() */
66#ifndef AT_CLKTCK 69#ifndef AT_CLKTCK
67# define AT_CLKTCK 17 70# define AT_CLKTCK 17
diff --git a/procps/uptime.c b/procps/uptime.c
index 1a7da46a3..74323625d 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -25,6 +25,10 @@
25//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n" 25//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
26 26
27#include "libbb.h" 27#include "libbb.h"
28#ifdef __linux__
29# include <sys/sysinfo.h>
30#endif
31
28 32
29#ifndef FSHIFT 33#ifndef FSHIFT
30# define FSHIFT 16 /* nr of bits of precision */ 34# define FSHIFT 16 /* nr of bits of precision */