summaryrefslogtreecommitdiff
path: root/src/cmd/5a/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/5a/lex.c')
-rw-r--r--src/cmd/5a/lex.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c
index 82f2228bf..8ca10249e 100644
--- a/src/cmd/5a/lex.c
+++ b/src/cmd/5a/lex.c
@@ -86,16 +86,13 @@ main(int argc, char *argv[])
c = 0;
nout = 0;
for(;;) {
+ Waitmsg *w;
+
while(nout < nproc && argc > 0) {
- i = myfork();
+ i = fork();
if(i < 0) {
- i = mywait(&status);
- if(i < 0)
- errorexit();
- if(status)
- c++;
- nout--;
- continue;
+ fprint(2, "fork: %r\n");
+ errorexit();
}
if(i == 0) {
print("%s:\n", *argv);
@@ -107,13 +104,13 @@ main(int argc, char *argv[])
argc--;
argv++;
}
- i = mywait(&status);
- if(i < 0) {
+ w = wait();
+ if(w == nil) {
if(c)
errorexit();
exits(0);
}
- if(status)
+ if(w->msg[0])
c++;
nout--;
}
@@ -160,7 +157,7 @@ assemble(char *file)
}
}
- of = mycreat(outfile, 0664);
+ of = create(outfile, OWRITE, 0664);
if(of < 0) {
yyerror("%ca: cannot create %s", thechar, outfile);
errorexit();