aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-07-05 21:43:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-07-05 21:43:28 +0200
commitf4f8fe841cf2df761eaade204a13e6fde6639666 (patch)
tree0b72ffb81fedfce0213f4f10ce78a71e67bb5e05 /libbb
parent1b0dcc02dd5a101d1a62f2111892a41621be96cf (diff)
downloadbusybox-w32-f4f8fe841cf2df761eaade204a13e6fde6639666.tar.gz
busybox-w32-f4f8fe841cf2df761eaade204a13e6fde6639666.tar.bz2
busybox-w32-f4f8fe841cf2df761eaade204a13e6fde6639666.zip
build system: fix a few warnings for allnoconfig build
Not that allnoconfig build is useful in any way... Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 791b81c17..c341817e2 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -841,6 +841,7 @@ static int busybox_main(char **argv)
841} 841}
842# endif 842# endif
843 843
844# if NUM_APPLETS > 0
844void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv) 845void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
845{ 846{
846 int argc = 1; 847 int argc = 1;
@@ -858,15 +859,15 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
858 * "true" and "false" are also special. 859 * "true" and "false" are also special.
859 */ 860 */
860 if (1 861 if (1
861#if defined APPLET_NO_test 862# if defined APPLET_NO_test
862 && applet_no != APPLET_NO_test 863 && applet_no != APPLET_NO_test
863#endif 864# endif
864#if defined APPLET_NO_true 865# if defined APPLET_NO_true
865 && applet_no != APPLET_NO_true 866 && applet_no != APPLET_NO_true
866#endif 867# endif
867#if defined APPLET_NO_false 868# if defined APPLET_NO_false
868 && applet_no != APPLET_NO_false 869 && applet_no != APPLET_NO_false
869#endif 870# endif
870 ) { 871 ) {
871 if (argc == 2 && strcmp(argv[1], "--help") == 0) { 872 if (argc == 2 && strcmp(argv[1], "--help") == 0) {
872 /* Make "foo --help" exit with 0: */ 873 /* Make "foo --help" exit with 0: */
@@ -878,19 +879,22 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
878 check_suid(applet_no); 879 check_suid(applet_no);
879 exit(applet_main[applet_no](argc, argv)); 880 exit(applet_main[applet_no](argc, argv));
880} 881}
882# endif /* NUM_APPLETS > 0 */
881 883
882static NORETURN void run_applet_and_exit(const char *name, char **argv) 884static NORETURN void run_applet_and_exit(const char *name, char **argv)
883{ 885{
884 int applet;
885
886# if ENABLE_BUSYBOX 886# if ENABLE_BUSYBOX
887 if (is_prefixed_with(name, "busybox")) 887 if (is_prefixed_with(name, "busybox"))
888 exit(busybox_main(argv)); 888 exit(busybox_main(argv));
889# endif 889# endif
890# if NUM_APPLETS > 0
890 /* find_applet_by_name() search is more expensive, so goes second */ 891 /* find_applet_by_name() search is more expensive, so goes second */
891 applet = find_applet_by_name(name); 892 {
892 if (applet >= 0) 893 int applet = find_applet_by_name(name);
893 run_applet_no_and_exit(applet, argv); 894 if (applet >= 0)
895 run_applet_no_and_exit(applet, argv);
896 }
897# endif
894 898
895 /*bb_error_msg_and_die("applet not found"); - links in printf */ 899 /*bb_error_msg_and_die("applet not found"); - links in printf */
896 full_write2_str(applet_name); 900 full_write2_str(applet_name);
@@ -957,10 +961,10 @@ int main(int argc UNUSED_PARAM, char **argv)
957#else 961#else
958 lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv)); 962 lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
959 963
960#if !ENABLE_BUSYBOX 964# if !ENABLE_BUSYBOX
961 if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox")) 965 if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
962 argv++; 966 argv++;
963#endif 967# endif
964 applet_name = argv[0]; 968 applet_name = argv[0];
965 if (applet_name[0] == '-') 969 if (applet_name[0] == '-')
966 applet_name++; 970 applet_name++;