hush: small optimization in run_list
I thought gcc can detect this itself. It doesn't. function old new delta run_list 1030 1021 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
5cc9bf6a21
commit
6c635d62d4
11
shell/hush.c
11
shell/hush.c
@ -8004,20 +8004,21 @@ static int run_list(struct pipe *pi)
|
|||||||
G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
|
G.last_bg_pid = pi->cmds[pi->num_cmds - 1].pid;
|
||||||
debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n");
|
debug_printf_exec(": cmd&: exitcode EXIT_SUCCESS\n");
|
||||||
/* Check pi->pi_inverted? "! sleep 1 & echo $?": bash says 1. dash and ash says 0 */
|
/* Check pi->pi_inverted? "! sleep 1 & echo $?": bash says 1. dash and ash says 0 */
|
||||||
G.last_exitcode = rcode = EXIT_SUCCESS;
|
rcode = EXIT_SUCCESS;
|
||||||
check_and_run_traps();
|
goto check_traps;
|
||||||
} else {
|
} else {
|
||||||
#if ENABLE_HUSH_JOB
|
#if ENABLE_HUSH_JOB
|
||||||
if (G.run_list_level == 1 && G_interactive_fd) {
|
if (G.run_list_level == 1 && G_interactive_fd) {
|
||||||
/* Waits for completion, then fg's main shell */
|
/* Waits for completion, then fg's main shell */
|
||||||
rcode = checkjobs_and_fg_shell(pi);
|
rcode = checkjobs_and_fg_shell(pi);
|
||||||
debug_printf_exec(": checkjobs_and_fg_shell exitcode %d\n", rcode);
|
debug_printf_exec(": checkjobs_and_fg_shell exitcode %d\n", rcode);
|
||||||
} else
|
goto check_traps;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
{ /* This one just waits for completion */
|
/* This one just waits for completion */
|
||||||
rcode = checkjobs(pi, 0 /*(no pid to wait for)*/);
|
rcode = checkjobs(pi, 0 /*(no pid to wait for)*/);
|
||||||
debug_printf_exec(": checkjobs exitcode %d\n", rcode);
|
debug_printf_exec(": checkjobs exitcode %d\n", rcode);
|
||||||
}
|
check_traps:
|
||||||
G.last_exitcode = rcode;
|
G.last_exitcode = rcode;
|
||||||
check_and_run_traps();
|
check_and_run_traps();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user