diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-09 09:48:58 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-09 09:48:58 +0100 |
commit | 6bf52b615d78542e41e684438c844af1fa4fb36e (patch) | |
tree | d7cc77f1b66091f99741a41f31ee66908788811d | |
parent | 80172e46221222f26680f3b9caf7637383205e7a (diff) | |
download | busybox-w32-6bf52b615d78542e41e684438c844af1fa4fb36e.tar.gz busybox-w32-6bf52b615d78542e41e684438c844af1fa4fb36e.tar.bz2 busybox-w32-6bf52b615d78542e41e684438c844af1fa4fb36e.zip |
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.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c index 12e09938a..75b36f748 100644 --- a/modutils/modprobe-small.c +++ b/modutils/modprobe-small.c | |||
@@ -58,8 +58,8 @@ | |||
58 | 58 | ||
59 | #define DEPFILE_BB CONFIG_DEFAULT_DEPMOD_FILE".bb" | 59 | #define DEPFILE_BB CONFIG_DEFAULT_DEPMOD_FILE".bb" |
60 | 60 | ||
61 | #define ONLY_APPLET (ENABLE_MODPROBE + ENABLE_DEPMOD + ENABLE_INSMOD \ | 61 | #define MOD_APPLET_CNT (ENABLE_MODPROBE + ENABLE_DEPMOD + ENABLE_INSMOD + ENABLE_LSMOD + ENABLE_RMMOD) |
62 | + ENABLE_LSMOD + ENABLE_RMMOD <= 1) | 62 | #define ONLY_APPLET (MOD_APPLET_CNT <= 1) |
63 | #define is_modprobe (ENABLE_MODPROBE && (ONLY_APPLET || applet_name[0] == 'm')) | 63 | #define is_modprobe (ENABLE_MODPROBE && (ONLY_APPLET || applet_name[0] == 'm')) |
64 | #define is_depmod (ENABLE_DEPMOD && (ONLY_APPLET || applet_name[0] == 'd')) | 64 | #define is_depmod (ENABLE_DEPMOD && (ONLY_APPLET || applet_name[0] == 'd')) |
65 | #define is_insmod (ENABLE_INSMOD && (ONLY_APPLET || applet_name[0] == 'i')) | 65 | #define is_insmod (ENABLE_INSMOD && (ONLY_APPLET || applet_name[0] == 'i')) |
@@ -933,7 +933,9 @@ The following options are useful for people managing distributions: | |||
933 | int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 933 | int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
934 | int modprobe_main(int argc UNUSED_PARAM, char **argv) | 934 | int modprobe_main(int argc UNUSED_PARAM, char **argv) |
935 | { | 935 | { |
936 | #if ENABLE_MODPROBE || ENABLE_INSMOD || ENABLE_RMMOD | ||
936 | int exitcode; | 937 | int exitcode; |
938 | #endif | ||
937 | struct utsname uts; | 939 | struct utsname uts; |
938 | IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(char *options = NULL;) | 940 | IF_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE(char *options = NULL;) |
939 | 941 | ||
@@ -954,7 +956,12 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) | |||
954 | } | 956 | } |
955 | uname(&uts); /* never fails */ | 957 | uname(&uts); /* never fails */ |
956 | 958 | ||
957 | if (is_depmod) { | 959 | /* depmod? */ |
960 | if ((MOD_APPLET_CNT == 2 && ENABLE_DEPMOD && ENABLE_LSMOD) | ||
961 | /* ^^^^only depmod and lsmod is configured^^^^^^^^^^^^^^^ */ | ||
962 | /* note: we already know here it is not lsmod (handled before) */ | ||
963 | || is_depmod | ||
964 | ) { | ||
958 | /* Supported: | 965 | /* Supported: |
959 | * -n: print result to stdout | 966 | * -n: print result to stdout |
960 | * -a: process all modules (default) | 967 | * -a: process all modules (default) |