aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/code.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-12-04 14:10:21 -0800
committerNicholas Noll <nbnoll@eml.cc>2021-12-04 14:10:21 -0800
commit12e09f9f85ac48ff891adf92f3b2c9a5fea27273 (patch)
tree60051793885e9978dadf6672ef85cdda216676a2 /src/cmd/rc/code.c
parentb80a3d28ce42be4fdec451f74620b10ee75219dc (diff)
Chore(REMOVE): finished deprecation of old io functions.
The old methods were simple wrappers of C standard library functions. We've moved (painfully) over to a new interface that allows for files to live on the stack. All users of the functionality are ported over.
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){