aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/utility.c b/utility.c
index a38ef86fb..81bff18e7 100644
--- a/utility.c
+++ b/utility.c
@@ -36,12 +36,16 @@
#include <unistd.h>
#include <ctype.h>
-#ifdef BB_MTAB
-const char mtab_file[] = "/etc/mtab";
-#else
#if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF
+# if defined BB_FEATURE_USE_PROCFS
const char mtab_file[] = "/proc/mounts";
-#endif
+# else
+# if defined BB_MTAB
+const char mtab_file[] = "/etc/mtab";
+# else
+# error With (BB_MOUNT||BB_UMOUNT||BB_DF) defined, you must define either BB_MTAB or BB_FEATURE_USE_PROCFS
+# endif
+# endif
#endif
@@ -56,6 +60,9 @@ extern void usage(const char *usage)
#if defined (BB_INIT) || defined (BB_PS)
+#if ! defined BB_FEATURE_USE_PROCFS
+#error Sorry, I depend on the /proc filesystem right now.
+#endif
/* Returns kernel version encoded as major*65536 + minor*256 + patch,
* so, for example, to check if the kernel is greater than 2.2.11:
* if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> }