summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2017-01-09 09:48:58 +0100
committerDenys Vlasenko2017-01-09 09:48:58 +0100
commit6bf52b615d78542e41e684438c844af1fa4fb36e (patch)
treed7cc77f1b66091f99741a41f31ee66908788811d
parent80172e46221222f26680f3b9caf7637383205e7a (diff)
downloadbusybox-6bf52b615d78542e41e684438c844af1fa4fb36e.zip
busybox-6bf52b615d78542e41e684438c844af1fa4fb36e.tar.gz
modprobe-small: build fixes
Was throwing some build errors: CONFIG_MODPROBE_SMALL=y CONFIG_DEPMOD=y CONFIG_LSMOD=y CONFIG_MODINFO=y CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y error: unused variable 'exitcode' modutils/modprobe-small.c: In function 'modprobe_main': modutils/modprobe-small.c:1060: error: control reaches end of non-void function Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--modutils/modprobe-small.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 12e0993..75b36f7 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -58,8 +58,8 @@
#define DEPFILE_BB CONFIG_DEFAULT_DEPMOD_FILE".bb"
-#define ONLY_APPLET (ENABLE_MODPROBE + ENABLE_DEPMOD + ENABLE_INSMOD \
- + ENABLE_LSMOD + ENABLE_RMMOD <= 1)
+#define MOD_APPLET_CNT (ENABLE_MODPROBE + ENABLE_DEPMOD + ENABLE_INSMOD + ENABLE_LSMOD + ENABLE_RMMOD)
+#define ONLY_APPLET (MOD_APPLET_CNT <= 1)
#define is_modprobe (ENABLE_MODPROBE && (ONLY_APPLET || applet_name[0] == 'm'))
#define is_depmod (ENABLE_DEPMOD && (ONLY_APPLET || applet_name[0] == 'd'))
#define is_insmod (ENABLE_INSMOD && (ONLY_APPLET || applet_name[0] == 'i'))
@@ -933,7 +933,9 @@ The following options are useful for people managing distributions:
int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int modprobe_main(int argc UNUSED_PARAM, char **argv)
{
+#if ENABLE_MODPROBE || ENABLE_INSMOD || ENABLE_RMMOD
int exitcode;
+#endif
struct utsname uts;
IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(char *options = NULL;)
@@ -954,7 +956,12 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv)
}
uname(&uts); /* never fails */
- if (is_depmod) {
+ /* depmod? */
+ if ((MOD_APPLET_CNT == 2 && ENABLE_DEPMOD && ENABLE_LSMOD)
+ /* ^^^^only depmod and lsmod is configured^^^^^^^^^^^^^^^ */
+ /* note: we already know here it is not lsmod (handled before) */
+ || is_depmod
+ ) {
/* Supported:
* -n: print result to stdout
* -a: process all modules (default)