mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jan Weitzel <J.Weitzel@phytec.de>
To: barebox@lists.infradead.org
Subject: [Patch] hush exit code fix
Date: Fri, 05 Mar 2010 11:51:50 +0100	[thread overview]
Message-ID: <1267786310.19729.11.camel@lws-weitzel> (raw)

hush: pass return code from exit command within if statement

Signed-off-by: Jan Weitzel <j.weitzel@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) {



_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2010-03-05 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 10:51 Jan Weitzel [this message]
2010-03-12  9:01 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1267786310.19729.11.camel@lws-weitzel \
    --to=j.weitzel@phytec.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox