aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-08-23 02:53:58 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-23 02:53:58 +0200
commitdc04439450e5929880205d920de3a26409727563 (patch)
tree5ee9110f0cb3ddd01f2ca6a5d7da87ee4a910443 /shell
parent941fce89fa346e06e936d4d3b58773c836127fd7 (diff)
downloadbusybox-w32-dc04439450e5929880205d920de3a26409727563.tar.gz
busybox-w32-dc04439450e5929880205d920de3a26409727563.tar.bz2
busybox-w32-dc04439450e5929880205d920de3a26409727563.zip
Version 1.17.2: apply post 1.17.1 fixes, replace patch applet by Rob's version
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c1
-rwxr-xr-x[-rw-r--r--]shell/ash_test/ash-redir/redir9.tests0
-rw-r--r--shell/ash_test/ash-signals/signal7.right1
-rwxr-xr-xshell/ash_test/ash-signals/signal7.tests18
-rw-r--r--shell/hush.c4
-rw-r--r--shell/hush_test/hush-trap/signal7.right1
-rwxr-xr-xshell/hush_test/hush-trap/signal7.tests18
-rw-r--r--shell/shell_common.c7
8 files changed, 47 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0337a5535..7cc5a913a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -4515,6 +4515,7 @@ clear_traps(void)
4515 INT_ON; 4515 INT_ON;
4516 } 4516 }
4517 } 4517 }
4518 may_have_traps = 0;
4518} 4519}
4519 4520
4520/* Lives far away from here, needed for forkchild */ 4521/* Lives far away from here, needed for forkchild */
diff --git a/shell/ash_test/ash-redir/redir9.tests b/shell/ash_test/ash-redir/redir9.tests
index 8befa611c..8befa611c 100644..100755
--- a/shell/ash_test/ash-redir/redir9.tests
+++ b/shell/ash_test/ash-redir/redir9.tests
diff --git a/shell/ash_test/ash-signals/signal7.right b/shell/ash_test/ash-signals/signal7.right
new file mode 100644
index 000000000..ba7453e42
--- /dev/null
+++ b/shell/ash_test/ash-signals/signal7.right
@@ -0,0 +1 @@
Bug detected: 0
diff --git a/shell/ash_test/ash-signals/signal7.tests b/shell/ash_test/ash-signals/signal7.tests
new file mode 100755
index 000000000..c2b1381f9
--- /dev/null
+++ b/shell/ash_test/ash-signals/signal7.tests
@@ -0,0 +1,18 @@
1bug() {
2 trap : exit
3 # Bug was causing sh to be run in subshell,
4 # as if this line is replaced with (sh -c ...; exit $?) &
5 # here:
6 sh -c 'echo REAL_CHILD=$$' &
7 echo PARENTS_IDEA_OF_CHILD=$!
8 wait # make sure bkgd shell completes
9}
10
11bug | {
12while read varval; do
13 eval $varval
14done
15test x"$REAL_CHILD" != x"" \
16&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD"
17echo "Bug detected: $?"
18}
diff --git a/shell/hush.c b/shell/hush.c
index 31ca22a2e..01bc96ce6 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -3901,8 +3901,6 @@ static void insert_bg_job(struct pipe *pi)
3901 3901
3902 if (G_interactive_fd) 3902 if (G_interactive_fd)
3903 printf("[%d] %d %s\n", job->jobid, job->cmds[0].pid, job->cmdtext); 3903 printf("[%d] %d %s\n", job->jobid, job->cmds[0].pid, job->cmdtext);
3904 /* Last command's pid goes to $! */
3905 G.last_bg_pid = job->cmds[job->num_cmds - 1].pid;
3906 G.last_jobid = job->jobid; 3904 G.last_jobid = job->jobid;
3907} 3905}
3908 3906
@@ -4825,6 +4823,8 @@ static int run_list(struct pipe *pi)
4825 if (G.run_list_level == 1) 4823 if (G.run_list_level == 1)
4826 insert_bg_job(pi); 4824 insert_bg_job(pi);
4827#endif 4825#endif
4826 /* Last command's pid goes to $! */
4827 G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
4828 G.last_exitcode = rcode = EXIT_SUCCESS; 4828 G.last_exitcode = rcode = EXIT_SUCCESS;
4829 debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n"); 4829 debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n");
4830 } else { 4830 } else {
diff --git a/shell/hush_test/hush-trap/signal7.right b/shell/hush_test/hush-trap/signal7.right
new file mode 100644
index 000000000..ba7453e42
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal7.right
@@ -0,0 +1 @@
Bug detected: 0
diff --git a/shell/hush_test/hush-trap/signal7.tests b/shell/hush_test/hush-trap/signal7.tests
new file mode 100755
index 000000000..c2b1381f9
--- /dev/null
+++ b/shell/hush_test/hush-trap/signal7.tests
@@ -0,0 +1,18 @@
1bug() {
2 trap : exit
3 # Bug was causing sh to be run in subshell,
4 # as if this line is replaced with (sh -c ...; exit $?) &
5 # here:
6 sh -c 'echo REAL_CHILD=$$' &
7 echo PARENTS_IDEA_OF_CHILD=$!
8 wait # make sure bkgd shell completes
9}
10
11bug | {
12while read varval; do
13 eval $varval
14done
15test x"$REAL_CHILD" != x"" \
16&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD"
17echo "Bug detected: $?"
18}
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 3114ff3f7..dc363e298 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -428,9 +428,14 @@ shell_builtin_ulimit(char **argv)
428 val <<= l->factor_shift; 428 val <<= l->factor_shift;
429 } 429 }
430//bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val); 430//bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val);
431 /* from man bash: "If neither -H nor -S
432 * is specified, both the soft and hard
433 * limits are set. */
434 if (!opts)
435 opts = OPT_hard + OPT_soft;
431 if (opts & OPT_hard) 436 if (opts & OPT_hard)
432 limit.rlim_max = val; 437 limit.rlim_max = val;
433 if ((opts & OPT_soft) || opts == 0) 438 if (opts & OPT_soft)
434 limit.rlim_cur = val; 439 limit.rlim_cur = val;
435//bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max); 440//bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max);
436 if (setrlimit(l->cmd, &limit) < 0) { 441 if (setrlimit(l->cmd, &limit) < 0) {