From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] hush: pass context around in shell
Date: Fri, 8 Oct 2010 14:24:32 +0200 [thread overview]
Message-ID: <1286540674-17174-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1286540674-17174-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/hush.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/common/hush.c b/common/hush.c
index 19e35f5..f22eca6 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -267,8 +267,8 @@ static void setup_string_in_str(struct in_str *i, const char *s);
static int free_pipe_list(struct pipe *head, int indent);
static int free_pipe(struct pipe *pi, int indent);
/* really run the final data structures: */
-static int run_list_real(struct pipe *pi);
-static int run_pipe_real(struct pipe *pi);
+static int run_list_real(struct p_context *ctx, struct pipe *pi);
+static int run_pipe_real(struct p_context *ctx, struct pipe *pi);
/* extended glob support: */
/* variable assignment: */
static int is_assignment(const char *s);
@@ -515,7 +515,7 @@ static void setup_string_in_str(struct in_str *i, const char *s)
* now has its stdout directed to the input of the appropriate pipe,
* so this routine is noticeably simpler.
*/
-static int run_pipe_real(struct pipe *pi)
+static int run_pipe_real(struct p_context *ctx, struct pipe *pi)
{
int i;
int nextin;
@@ -541,7 +541,7 @@ static int run_pipe_real(struct pipe *pi)
if (pi->num_progs == 1 && child->group) {
int rcode;
debug("non-subshell grouping\n");
- rcode = run_list_real(child->group);
+ rcode = run_list_real(ctx, child->group);
return rcode;
} else if (pi->num_progs == 1 && pi->progs[0].argv != NULL) {
for (i=0; is_assignment(child->argv[i]); i++) { /* nothing */ }
@@ -601,7 +601,7 @@ static int run_pipe_real(struct pipe *pi)
return -1;
}
-static int run_list_real(struct pipe *pi)
+static int run_list_real(struct p_context *ctx, struct pipe *pi)
{
char *save_name = NULL;
char **list = NULL;
@@ -699,7 +699,7 @@ static int run_list_real(struct pipe *pi)
}
if (pi->num_progs == 0)
continue;
- rcode = run_pipe_real(pi);
+ rcode = run_pipe_real(ctx, pi);
debug("run_pipe_real returned %d\n",rcode);
if (rcode < -1) {
last_return_code = -rcode - 2;
@@ -853,11 +853,11 @@ static int xglob(o_string *dest, int flags, glob_t *pglob)
}
/* Select which version we will use */
-static int run_list(struct pipe *pi)
+static int run_list(struct p_context *ctx, struct pipe *pi)
{
int rcode = 0;
- rcode = run_list_real(pi);
+ rcode = run_list_real(ctx, pi);
/* free_pipe_list has the side effect of clearing memory
* In the long run that function can be merged with run_list_real,
@@ -1371,7 +1371,7 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
done_word(&temp, ctx);
done_pipe(ctx,PIPE_SEQ);
if (ctx->list_head->num_progs) {
- code = run_list(ctx->list_head);
+ code = run_list(ctx, ctx->list_head);
} else {
free_pipe_list(ctx->list_head, 0);
continue;
--
1.7.2.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2010-10-08 12:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 12:24 Sascha Hauer
2010-10-08 12:24 ` Sascha Hauer [this message]
2010-10-08 12:24 ` [PATCH 2/3] hush: fix nasty memory leak in hush Sascha Hauer
2010-10-08 12:24 ` [PATCH 3/3] hush: implement getopt builtin Sascha Hauer
2010-10-08 12:36 ` Jean-Christophe PLAGNIOL-VILLARD
2010-10-08 12:45 ` Sascha Hauer
2010-10-11 5:08 ` Jean-Christophe PLAGNIOL-VILLARD
2010-10-08 13:31 ` [PATCH 3/3 v2] " 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=1286540674-17174-2-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.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