aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/code.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/rc/code.c')
-rw-r--r--src/cmd/rc/code.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cmd/rc/code.c b/src/cmd/rc/code.c
index 47266e4..9c6316c 100644
--- a/src/cmd/rc/code.c
+++ b/src/cmd/rc/code.c
@@ -17,8 +17,7 @@ static struct Interpreter interpreter;
#define emitf(x) ((void)(interpreter.i != interpreter.cap || grow()), interpreter.code[interpreter.i].f = (x), interpreter.i++)
#define emits(x) ((void)(interpreter.i != interpreter.cap || grow()), interpreter.code[interpreter.i].s = (x), interpreter.i++)
-static
-int
+static int
grow(void)
{
interpreter.cap += 100;
@@ -28,8 +27,7 @@ grow(void)
return 0;
}
-static
-void
+static void
storepc(int a)
{
if(interpreter.i <= a || a < 0)
@@ -342,12 +340,17 @@ walk(Tree *node)
storepc(addr2);
emitf(Xpipewait);
-
break;
-#if 0
case Tpipefd:
-#endif
+ emitf(Xpipefd);
+ emiti(node->redir.type);
+ addr1 = emiti(0);
+
+ walk(node->child[0]);
+ emitf(Xexit);
+ storepc(addr1);
+ break;
case Tdup:
if(node->redir.type == Rdupfd){