diff options
author | Herve Codina <Herve.CODINA@celad.com> | 2014-07-07 10:45:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-07-09 07:38:12 +0200 |
commit | 6ae5677190379ad00a57d72f6ef010b17d243f95 (patch) | |
tree | 6934b6c2a2c34b8a540072132dd1f2f149fafb88 /common/hush.c | |
parent | 00e5e81a1d0c6cbbb861502aae29262a4138e8e7 (diff) | |
download | barebox-6ae5677190379ad00a57d72f6ef010b17d243f95.tar.gz barebox-6ae5677190379ad00a57d72f6ef010b17d243f95.tar.xz |
hush: Fix error code returned value
Just returns error code instead of 0 or 1.
With this fix, $? is set to child exit code in all cases.
Without this fix, /child $PATH;echo $? displays 1 even if
child script calls exit with a specific non zero error code.
Signed-off-by: Herve Codina <Herve.CODINA@celad.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/hush.c')
-rw-r--r-- | common/hush.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/hush.c b/common/hush.c index 6be43cf8ea..f6aaa03514 100644 --- a/common/hush.c +++ b/common/hush.c @@ -1724,7 +1724,7 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla b_free(&temp); } while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP)); /* loop on syntax errors, return on EOF */ - return (code != 0) ? 1 : 0; + return code; } static int parse_string_outer(struct p_context *ctx, const char *s, int flag) |