[Patch] hush exit code fix

Jan Weitzel J.Weitzel at phytec.de
Fri Mar 5 05:51:50 EST 2010


hush: pass return code from exit command within if statement

Signed-off-by: Jan Weitzel <j.weitzel at phytec.de>
---
diff --git a/common/hush.c b/common/hush.c
index cf6704b..ae09374 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -535,10 +535,9 @@ static int run_pipe_real(struct pipe *pi)
        if (pi->num_progs == 1)
                child = & (pi->progs[0]);
        if (pi->num_progs == 1 && child->group) {
-               int rcode;
                debug("non-subshell grouping\n");
-               rcode = run_list_real(child->group);
-               return rcode;
+               run_list_real(child->group);
+               return last_return_code;
        } else if (pi->num_progs == 1 && pi->progs[0].argv != NULL) {
                for (i=0; is_assignment(child->argv[i]); i++) { /* nothing */ }
                if (i!=0 && child->argv[i]==NULL) {





More information about the barebox mailing list