diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-28 06:49:03 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-28 06:49:03 +0000 |
commit | 1aa7e477b1b727db77cac2d717f0fcca40587f78 (patch) | |
tree | 247171517f0e01d32a71a5e96f4bef462cc0e9c6 /shell/hush.c | |
parent | 79c6904faff1ebd4bf4b7d9cd0c20ca70f4cec75 (diff) | |
download | busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.tar.gz busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.tar.bz2 busybox-w32-1aa7e477b1b727db77cac2d717f0fcca40587f78.zip |
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.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c index f7e2a4a14..8e42a8f3f 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -83,7 +83,7 @@ | |||
83 | 83 | ||
84 | extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ | 84 | extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ |
85 | 85 | ||
86 | #include "busybox.h" /* for struct bb_applet */ | 86 | #include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */ |
87 | 87 | ||
88 | 88 | ||
89 | #if !BB_MMU | 89 | #if !BB_MMU |
@@ -1464,12 +1464,12 @@ static void pseudo_exec_argv(char **argv) | |||
1464 | /* Check if the command matches any busybox applets */ | 1464 | /* Check if the command matches any busybox applets */ |
1465 | #if ENABLE_FEATURE_SH_STANDALONE | 1465 | #if ENABLE_FEATURE_SH_STANDALONE |
1466 | if (strchr(argv[0], '/') == NULL) { | 1466 | if (strchr(argv[0], '/') == NULL) { |
1467 | const struct bb_applet *a = find_applet_by_name(argv[0]); | 1467 | int a = find_applet_by_name(argv[0]); |
1468 | if (a) { | 1468 | if (a >= 0) { |
1469 | if (a->noexec) { | 1469 | if (APPLET_IS_NOEXEC(a)) { |
1470 | debug_printf_exec("running applet '%s'\n", argv[0]); | 1470 | debug_printf_exec("running applet '%s'\n", argv[0]); |
1471 | // is it ok that run_appletstruct_and_exit() does exit(), not _exit()? | 1471 | // is it ok that run_applet_no_and_exit() does exit(), not _exit()? |
1472 | run_appletstruct_and_exit(a, argv); | 1472 | run_applet_no_and_exit(a, argv); |
1473 | } | 1473 | } |
1474 | /* re-exec ourselves with the new arguments */ | 1474 | /* re-exec ourselves with the new arguments */ |
1475 | debug_printf_exec("re-execing applet '%s'\n", argv[0]); | 1475 | debug_printf_exec("re-execing applet '%s'\n", argv[0]); |
@@ -1855,8 +1855,8 @@ static int run_pipe_real(struct pipe *pi) | |||
1855 | } | 1855 | } |
1856 | #if ENABLE_FEATURE_SH_STANDALONE | 1856 | #if ENABLE_FEATURE_SH_STANDALONE |
1857 | { | 1857 | { |
1858 | const struct bb_applet *a = find_applet_by_name(argv[i]); | 1858 | int a = find_applet_by_name(argv[i]); |
1859 | if (a && a->nofork) { | 1859 | if (a >= 0 && APPLET_IS_NOFORK(a)) { |
1860 | setup_redirects(child, squirrel); | 1860 | setup_redirects(child, squirrel); |
1861 | save_nofork_data(&nofork_save); | 1861 | save_nofork_data(&nofork_save); |
1862 | argv_expanded = argv + i; | 1862 | argv_expanded = argv + i; |