diff options
author | Denys Vlasenko | 2010-03-28 20:01:31 +0200 |
---|---|---|
committer | Denys Vlasenko | 2010-03-28 20:01:31 +0200 |
commit | 58cdca3984beb4e1019ef5ccf1dd7361f032a9a6 (patch) | |
tree | 922928fdb79cbdb6a02ffbeab7948c03ad501656 /shell | |
parent | e52b735231bda70d811e4f9ef0e21fb2c7af96a2 (diff) | |
download | busybox-1_16_1.zip busybox-1_16_1.tar.gz |
apply post-1.16.0 fixes, bump version to 1.16.11_16_1
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 13 | ||||
-rw-r--r-- | shell/ash_test/ash-misc/nulltick1.right | 3 | ||||
-rwxr-xr-x | shell/ash_test/ash-misc/nulltick1.tests | 3 | ||||
-rw-r--r-- | shell/hush.c | 12 |
4 files changed, 22 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c index 798d15a..34f70ec 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -43,8 +43,6 @@ #endif #include "busybox.h" /* for applet_names */ -//TODO: pull in some .h and find out do we have SINGLE_APPLET_MAIN? -//#include "applet_tables.h" doesn't work #include <paths.h> #include <setjmp.h> #include <fnmatch.h> @@ -58,12 +56,15 @@ # define CLEAR_RANDOM_T(rnd) ((void)0) #endif -#if defined SINGLE_APPLET_MAIN +#define SKIP_definitions 1 +#include "applet_tables.h" +#undef SKIP_definitions +#if NUM_APPLETS == 1 /* STANDALONE does not make sense, and won't compile */ # undef CONFIG_FEATURE_SH_STANDALONE # undef ENABLE_FEATURE_SH_STANDALONE # undef IF_FEATURE_SH_STANDALONE -# undef IF_NOT_FEATURE_SH_STANDALONE(...) +# undef IF_NOT_FEATURE_SH_STANDALONE # define ENABLE_FEATURE_SH_STANDALONE 0 # define IF_FEATURE_SH_STANDALONE(...) # define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ @@ -4539,7 +4540,7 @@ forkchild(struct job *jp, union node *n, int mode) if (mode == FORK_NOJOB /* is it `xxx` ? */ && n && n->type == NCMD /* is it single cmd? */ /* && n->ncmd.args->type == NARG - always true? */ - && strcmp(n->ncmd.args->narg.text, "trap") == 0 + && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "trap") == 0 && n->ncmd.args->narg.next == NULL /* "trap" with no arguments */ /* && n->ncmd.args->narg.backquote == NULL - do we need to check this? */ ) { @@ -4627,7 +4628,7 @@ forkchild(struct job *jp, union node *n, int mode) } #if JOBS if (n && n->type == NCMD - && strcmp(n->ncmd.args->narg.text, "jobs") == 0 + && n->ncmd.args && strcmp(n->ncmd.args->narg.text, "jobs") == 0 ) { TRACE(("Job hack\n")); /* "jobs": we do not want to clear job list for it, diff --git a/shell/ash_test/ash-misc/nulltick1.right b/shell/ash_test/ash-misc/nulltick1.right new file mode 100644 index 0000000..f90b820 --- /dev/null +++ b/shell/ash_test/ash-misc/nulltick1.right @@ -0,0 +1,3 @@ +Test 1 +Test 2 +Done diff --git a/shell/ash_test/ash-misc/nulltick1.tests b/shell/ash_test/ash-misc/nulltick1.tests new file mode 100755 index 0000000..f81923d --- /dev/null +++ b/shell/ash_test/ash-misc/nulltick1.tests @@ -0,0 +1,3 @@ +echo Test ` ` 1 +echo Test `</dev/null` 2 +echo Done diff --git a/shell/hush.c b/shell/hush.c index e0c5626..2aeb8e4 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -125,14 +125,18 @@ # define USE_FOR_MMU(...) #endif -#if defined SINGLE_APPLET_MAIN +#define SKIP_definitions 1 +#include "applet_tables.h" +#undef SKIP_definitions +#if NUM_APPLETS == 1 /* STANDALONE does not make sense, and won't compile */ # undef CONFIG_FEATURE_SH_STANDALONE # undef ENABLE_FEATURE_SH_STANDALONE # undef IF_FEATURE_SH_STANDALONE +# undef IF_NOT_FEATURE_SH_STANDALONE +# define ENABLE_FEATURE_SH_STANDALONE 0 # define IF_FEATURE_SH_STANDALONE(...) # define IF_NOT_FEATURE_SH_STANDALONE(...) __VA_ARGS__ -# define ENABLE_FEATURE_SH_STANDALONE 0 #endif #if !ENABLE_HUSH_INTERACTIVE @@ -3568,7 +3572,9 @@ static void execvp_or_die(char **argv) { debug_printf_exec("execing '%s'\n", argv[0]); sigprocmask(SIG_SETMASK, &G.inherited_set, NULL); - execvp(argv[0], argv); + /* if FEATURE_SH_STANDALONE, "exec <applet_name>" should work, + * therefore we should use BB_EXECVP, not execvp */ + BB_EXECVP(argv[0], argv); bb_perror_msg("can't execute '%s'", argv[0]); _exit(127); /* bash compat */ } |