rename: run_applet_by_name -> run_applet_and_exit
authorDenis Vlasenko <vda.linux@googlemail.com>
Wed, 11 Apr 2007 17:03:19 +0000 (17:03 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Wed, 11 Apr 2007 17:03:19 +0000 (17:03 -0000)
applets/applets.c
docs/busybox.net/FAQ.html
include/libbb.h
scripts/individual
shell/bbsh.c
shell/hush.c
shell/lash.c
shell/msh.c

index 6f38ccee825903177533dc8bed2493ad5f4459db..958defe754f1fd74771bfb696b9ee30e8e086265 100644 (file)
@@ -541,7 +541,7 @@ static int busybox_main(int argc, char **argv)
                if (argc > 2) {
                        /* set name for proper "<name>: applet not found" */
                        applet_name = argv[2];
-                       run_applet_by_name(applet_name, 2, argv);
+                       run_applet_and_exit(applet_name, 2, argv);
                } else {
                        const struct bb_applet *a;
                        int col, output_width;
@@ -582,7 +582,7 @@ static int busybox_main(int argc, char **argv)
        } else {
                /* we want "<argv[1]>: applet not found", not "busybox: ..." */
                applet_name = argv[1];
-               run_applet_by_name(argv[1], argc - 1, argv + 1);
+               run_applet_and_exit(argv[1], argc - 1, argv + 1);
        }
 
        bb_error_msg_and_die("applet not found");
@@ -598,7 +598,7 @@ void run_current_applet_and_exit(int argc, char **argv)
        exit(current_applet->main(argc, argv));
 }
 
-void run_applet_by_name(const char *name, int argc, char **argv)
+void run_applet_and_exit(const char *name, int argc, char **argv)
 {
        current_applet = find_applet_by_name(name);
        if (current_applet)
@@ -633,6 +633,6 @@ int main(int argc, char **argv)
        if (ENABLE_LOCALE_SUPPORT && getpid() != 1)
                setlocale(LC_ALL, "");
 
-       run_applet_by_name(applet_name, argc, argv);
+       run_applet_and_exit(applet_name, argc, argv);
        bb_error_msg_and_die("applet not found");
 }
index c07be9027b3035cd75d6e85689a5abb802236eae..214c1905e89a313abe3e7e9d4b51e995875a58e0 100644 (file)
@@ -531,7 +531,7 @@ applets.</p>
 
 <p>Busybox execution starts with the main() function in applets/busybox.c,
 which sets the global variable applet_name to argv[0] and calls
-run_applet_by_name() in applets/applets.c.  That uses the applets[] array
+run_applet_and_exit() in applets/applets.c.  That uses the applets[] array
 (defined in include/busybox.h and filled out in include/applets.h) to
 transfer control to the appropriate APPLET_main() function (such as
 cat_main() or sed_main()).  The individual applet takes it from there.</p>
index 11fcd19f22d92956ea3bd259f548c86065a836a2..c3baf9e7c81f7d0358cd99ada2109b7fddbb2394 100644 (file)
@@ -675,7 +675,7 @@ const struct hwtype *get_hwntype(int type);
 struct bb_applet;
 extern const struct bb_applet *find_applet_by_name(const char *name);
 /* Returns only if applet is not found. */
-extern void run_applet_by_name(const char *name, int argc, char **argv);
+extern void run_applet_and_exit(const char *name, int argc, char **argv);
 extern void run_current_applet_and_exit(int argc, char **argv) ATTRIBUTE_NORETURN;
 #endif
 
index a09a5dc7ae94061ea689bec2fd10aa77a08db86b..e93ca5552724f809a1834b969e7cfb73e0545110 100755 (executable)
@@ -106,7 +106,7 @@ function buildit ()
     gcc -Os -o build/$APPLET applets/individual.c $j \
        `extra_libraries $APPFILT` libbb/libbb.a -Iinclude \
        -DBUILD_INDIVIDUAL \
-       '-Drun_applet_by_name(...)' '-Dfind_applet_by_name(...)=0' \
+       '-Drun_applet_and_exit(...)' '-Dfind_applet_by_name(...)=0' \
        -DAPPLET_main=${APPFILT}_main -DAPPLET_full_usage=${HELPNAME}
     if [ $? -ne 0 ];
     then
index 06fd0131e688c71e6edf39715bcda877f94e8482..6bef3685a78615b3f9489a2f3796df3603ad4eaa 100644 (file)
@@ -165,7 +165,7 @@ static int run_pipeline(struct pipeline *line)
                int status;
                pid_t pid=fork();
                if(!pid) {
-                       run_applet_by_name(cmd->argv[0],cmd->argc,cmd->argv);
+                       run_applet_and_exit(cmd->argv[0],cmd->argc,cmd->argv);
                        execvp(cmd->argv[0],cmd->argv);
                        printf("No %s",cmd->argv[0]);
                        exit(1);
index f6c69a2214c2e2f076f2dc23b281baa53715c6e3..3048d695af6ca35035f7b33a136ee8e4ef6f5258 100644 (file)
@@ -1123,7 +1123,7 @@ static void pseudo_exec(struct child_prog *child)
                                /**/;
                        optind = 1;
                        debug_printf("running applet %s\n", name);
-                       run_applet_by_name(name, argc_l, child->argv);
+                       run_applet_and_exit(name, argc_l, child->argv);
                }
 #endif
                debug_printf("exec of %s\n", child->argv[0]);
index 99e2b1f0666559da55df4dc65915c76f83ede281..f91bec254b2923fd405f2a1a536ff6cde6fb299e 100644 (file)
@@ -1170,7 +1170,7 @@ static int pseudo_exec(struct child_prog *child)
 
                for (argc_l = 0; *argv_l; argv_l++, argc_l++);
                optind = 1;
-               run_applet_by_name(child->argv[0], argc_l, child->argv);
+               run_applet_and_exit(child->argv[0], argc_l, child->argv);
        }
 
        execvp(child->argv[0], child->argv);
index 0337a4f06f1414388d61d61d3b7e45c3242e8492..963e59446d76ac725fe2d65665a840a7a04c3103 100644 (file)
@@ -3068,7 +3068,7 @@ static const char *rexecve(char *c, char **v, char **envp)
                optind = 1;
                if (find_applet_by_name(name)) {
                        /* We have to exec here since we vforked.  Running
-                        * run_applet_by_name() won't work and bad things
+                        * run_applet_and_exit() won't work and bad things
                         * will happen. */
                        execve(CONFIG_BUSYBOX_EXEC_PATH, v, envp);
                }