summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-11-28 06:49:03 +0000
committerDenis Vlasenko2007-11-28 06:49:03 +0000
commit1aa7e477b1b727db77cac2d717f0fcca40587f78 (patch)
tree247171517f0e01d32a71a5e96f4bef462cc0e9c6 /shell/hush.c
parent79c6904faff1ebd4bf4b7d9cd0c20ca70f4cec75 (diff)
downloadbusybox-1aa7e477b1b727db77cac2d717f0fcca40587f78.zip
busybox-1aa7e477b1b727db77cac2d717f0fcca40587f78.tar.gz
reorganize applet table. Eliminates pointers to names.
Should be a big win for libbusybox. busybox wins too: text data bss dec hex filename 776524 929 9100 786553 c0079 busybox_old 775903 929 9100 785932 bfe0c busybox_unstripped
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c
index f7e2a4a..8e42a8f 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -83,7 +83,7 @@
extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
-#include "busybox.h" /* for struct bb_applet */
+#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
#if !BB_MMU
@@ -1464,12 +1464,12 @@ static void pseudo_exec_argv(char **argv)
/* Check if the command matches any busybox applets */
#if ENABLE_FEATURE_SH_STANDALONE
if (strchr(argv[0], '/') == NULL) {
- const struct bb_applet *a = find_applet_by_name(argv[0]);
- if (a) {
- if (a->noexec) {
+ int a = find_applet_by_name(argv[0]);
+ if (a >= 0) {
+ if (APPLET_IS_NOEXEC(a)) {
debug_printf_exec("running applet '%s'\n", argv[0]);
-// is it ok that run_appletstruct_and_exit() does exit(), not _exit()?
- run_appletstruct_and_exit(a, argv);
+// is it ok that run_applet_no_and_exit() does exit(), not _exit()?
+ run_applet_no_and_exit(a, argv);
}
/* re-exec ourselves with the new arguments */
debug_printf_exec("re-execing applet '%s'\n", argv[0]);
@@ -1855,8 +1855,8 @@ static int run_pipe_real(struct pipe *pi)
}
#if ENABLE_FEATURE_SH_STANDALONE
{
- const struct bb_applet *a = find_applet_by_name(argv[i]);
- if (a && a->nofork) {
+ int a = find_applet_by_name(argv[i]);
+ if (a >= 0 && APPLET_IS_NOFORK(a)) {
setup_redirects(child, squirrel);
save_nofork_data(&nofork_save);
argv_expanded = argv + i;