aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index b682e6b85..281123c37 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -701,7 +701,7 @@ static void install_links(const char *busybox, int use_symbolic_links,
701 continue; 701 continue;
702 } 702 }
703} 703}
704# else 704# elif ENABLE_BUSYBOX
705static void install_links(const char *busybox UNUSED_PARAM, 705static void install_links(const char *busybox UNUSED_PARAM,
706 int use_symbolic_links UNUSED_PARAM, 706 int use_symbolic_links UNUSED_PARAM,
707 char *custom_install_dir UNUSED_PARAM) 707 char *custom_install_dir UNUSED_PARAM)
@@ -709,6 +709,7 @@ static void install_links(const char *busybox UNUSED_PARAM,
709} 709}
710# endif 710# endif
711 711
712# if ENABLE_BUSYBOX
712/* If we were called as "busybox..." */ 713/* If we were called as "busybox..." */
713static int busybox_main(char **argv) 714static int busybox_main(char **argv)
714{ 715{
@@ -784,10 +785,10 @@ static int busybox_main(char **argv)
784 const char *a = applet_names; 785 const char *a = applet_names;
785 dup2(1, 2); 786 dup2(1, 2);
786 while (*a) { 787 while (*a) {
787# if ENABLE_FEATURE_INSTALLER 788# if ENABLE_FEATURE_INSTALLER
788 if (argv[1][6]) /* --list-full? */ 789 if (argv[1][6]) /* --list-full? */
789 full_write2_str(install_dir[APPLET_INSTALL_LOC(i)] + 1); 790 full_write2_str(install_dir[APPLET_INSTALL_LOC(i)] + 1);
790# endif 791# endif
791 full_write2_str(a); 792 full_write2_str(a);
792 full_write2_str("\n"); 793 full_write2_str("\n");
793 i++; 794 i++;
@@ -843,6 +844,7 @@ static int busybox_main(char **argv)
843 /* POSIX: "If a command is not found, the exit status shall be 127" */ 844 /* POSIX: "If a command is not found, the exit status shall be 127" */
844 exit(127); 845 exit(127);
845} 846}
847# endif
846 848
847void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv) 849void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
848{ 850{
@@ -886,8 +888,10 @@ void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
886{ 888{
887 int applet; 889 int applet;
888 890
891# if ENABLE_BUSYBOX
889 if (is_prefixed_with(name, "busybox")) 892 if (is_prefixed_with(name, "busybox"))
890 exit(busybox_main(argv)); 893 exit(busybox_main(argv));
894# endif
891 /* find_applet_by_name() search is more expensive, so goes second */ 895 /* find_applet_by_name() search is more expensive, so goes second */
892 applet = find_applet_by_name(name); 896 applet = find_applet_by_name(name);
893 if (applet >= 0) 897 if (applet >= 0)