3 @@ -4515,6 +4515,7 @@ clear_traps(void)
10 /* Lives far away from here, needed for forkchild */
11 diff -urpN busybox-1.17.1/shell/ash_test/ash-signals/signal7.right busybox-1.17.1-shell/shell/ash_test/ash-signals/signal7.right
12 --- busybox-1.17.1/shell/ash_test/ash-signals/signal7.right 1970-01-01 01:00:00.000000000 +0100
13 +++ busybox-1.17.1-shell/shell/ash_test/ash-signals/signal7.right 2010-07-25 13:09:32.000000000 +0200
16 diff -urpN busybox-1.17.1/shell/ash_test/ash-signals/signal7.tests busybox-1.17.1-shell/shell/ash_test/ash-signals/signal7.tests
17 --- busybox-1.17.1/shell/ash_test/ash-signals/signal7.tests 1970-01-01 01:00:00.000000000 +0100
18 +++ busybox-1.17.1-shell/shell/ash_test/ash-signals/signal7.tests 2010-07-25 13:09:32.000000000 +0200
22 + # Bug was causing sh to be run in subshell,
23 + # as if this line is replaced with (sh -c ...; exit $?) &
25 + sh -c 'echo REAL_CHILD=$$' &
26 + echo PARENTS_IDEA_OF_CHILD=$!
27 + wait # make sure bkgd shell completes
31 +while read varval; do
34 +test x"$REAL_CHILD" != x"" \
35 +&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD"
36 +echo "Bug detected: $?"
38 diff -urpN busybox-1.17.1/shell/hush.c busybox-1.17.1-shell/shell/hush.c
39 --- busybox-1.17.1/shell/hush.c 2010-07-25 00:12:43.000000000 +0200
40 +++ busybox-1.17.1-shell/shell/hush.c 2010-07-25 13:09:32.000000000 +0200
41 @@ -3901,8 +3901,6 @@ static void insert_bg_job(struct pipe *p
44 printf("[%d] %d %s\n", job->jobid, job->cmds[0].pid, job->cmdtext);
45 - /* Last command's pid goes to $! */
46 - G.last_bg_pid = job->cmds[job->num_cmds - 1].pid;
47 G.last_jobid = job->jobid;
50 @@ -4825,6 +4823,8 @@ static int run_list(struct pipe *pi)
51 if (G.run_list_level == 1)
54 + /* Last command's pid goes to $! */
55 + G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
56 G.last_exitcode = rcode = EXIT_SUCCESS;
57 debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n");
59 diff -urpN busybox-1.17.1/shell/hush_test/hush-trap/signal7.right busybox-1.17.1-shell/shell/hush_test/hush-trap/signal7.right
60 --- busybox-1.17.1/shell/hush_test/hush-trap/signal7.right 1970-01-01 01:00:00.000000000 +0100
61 +++ busybox-1.17.1-shell/shell/hush_test/hush-trap/signal7.right 2010-07-25 13:09:32.000000000 +0200
64 diff -urpN busybox-1.17.1/shell/hush_test/hush-trap/signal7.tests busybox-1.17.1-shell/shell/hush_test/hush-trap/signal7.tests
65 --- busybox-1.17.1/shell/hush_test/hush-trap/signal7.tests 1970-01-01 01:00:00.000000000 +0100
66 +++ busybox-1.17.1-shell/shell/hush_test/hush-trap/signal7.tests 2010-07-25 13:09:32.000000000 +0200
70 + # Bug was causing sh to be run in subshell,
71 + # as if this line is replaced with (sh -c ...; exit $?) &
73 + sh -c 'echo REAL_CHILD=$$' &
74 + echo PARENTS_IDEA_OF_CHILD=$!
75 + wait # make sure bkgd shell completes
79 +while read varval; do
82 +test x"$REAL_CHILD" != x"" \
83 +&& test x"$REAL_CHILD" = x"$PARENTS_IDEA_OF_CHILD"
84 +echo "Bug detected: $?"
86 diff -urpN busybox-1.17.1/shell/shell_common.c busybox-1.17.1-shell/shell/shell_common.c
87 --- busybox-1.17.1/shell/shell_common.c 2010-07-06 04:25:54.000000000 +0200
88 +++ busybox-1.17.1-shell/shell/shell_common.c 2010-07-27 08:41:43.000000000 +0200
89 @@ -428,9 +428,14 @@ shell_builtin_ulimit(char **argv)
90 val <<= l->factor_shift;
92 //bb_error_msg("opt %c val_str:'%s' val:%lld", opt_char, val_str, (long long)val);
93 + /* from man bash: "If neither -H nor -S
94 + * is specified, both the soft and hard
95 + * limits are set. */
97 + opts = OPT_hard + OPT_soft;
100 - if ((opts & OPT_soft) || opts == 0)
101 + if (opts & OPT_soft)
102 limit.rlim_cur = val;
103 //bb_error_msg("setrlimit(%d, %lld, %lld)", l->cmd, (long long)limit.rlim_cur, (long long)limit.rlim_max);
104 if (setrlimit(l->cmd, &limit) < 0) {