diff options
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -36,12 +36,16 @@ | |||
36 | #include <unistd.h> | 36 | #include <unistd.h> |
37 | #include <ctype.h> | 37 | #include <ctype.h> |
38 | 38 | ||
39 | #ifdef BB_MTAB | ||
40 | const char mtab_file[] = "/etc/mtab"; | ||
41 | #else | ||
42 | #if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF | 39 | #if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF |
40 | # if defined BB_FEATURE_USE_PROCFS | ||
43 | const char mtab_file[] = "/proc/mounts"; | 41 | const char mtab_file[] = "/proc/mounts"; |
44 | #endif | 42 | # else |
43 | # if defined BB_MTAB | ||
44 | const char mtab_file[] = "/etc/mtab"; | ||
45 | # else | ||
46 | # error With (BB_MOUNT||BB_UMOUNT||BB_DF) defined, you must define either BB_MTAB or BB_FEATURE_USE_PROCFS | ||
47 | # endif | ||
48 | # endif | ||
45 | #endif | 49 | #endif |
46 | 50 | ||
47 | 51 | ||
@@ -56,6 +60,9 @@ extern void usage(const char *usage) | |||
56 | 60 | ||
57 | #if defined (BB_INIT) || defined (BB_PS) | 61 | #if defined (BB_INIT) || defined (BB_PS) |
58 | 62 | ||
63 | #if ! defined BB_FEATURE_USE_PROCFS | ||
64 | #error Sorry, I depend on the /proc filesystem right now. | ||
65 | #endif | ||
59 | /* Returns kernel version encoded as major*65536 + minor*256 + patch, | 66 | /* Returns kernel version encoded as major*65536 + minor*256 + patch, |
60 | * so, for example, to check if the kernel is greater than 2.2.11: | 67 | * so, for example, to check if the kernel is greater than 2.2.11: |
61 | * if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> } | 68 | * if (get_kernel_revision() <= 2*65536+2*256+11) { <stuff> } |