diff options
Diffstat (limited to 'src/cmd/6a/lex.c')
-rw-r--r-- | src/cmd/6a/lex.c | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/src/cmd/6a/lex.c b/src/cmd/6a/lex.c index 22539fc7e..7621021c4 100644 --- a/src/cmd/6a/lex.c +++ b/src/cmd/6a/lex.c @@ -33,11 +33,30 @@ #include "y.tab.h" #include <ctype.h> +enum +{ + Plan9 = 1<<0, + Unix = 1<<1, + Windows = 1<<2, +}; + +int +systemtype(int sys) +{ + return sys&Plan9; +} + +int +pathchar(void) +{ + return '/'; +} + void main(int argc, char *argv[]) { char *p; - int nout, nproc, status, i, c; + int nout, nproc, i, c; thechar = '6'; thestring = "amd64"; @@ -83,16 +102,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); @@ -104,13 +120,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--; } @@ -157,7 +173,7 @@ assemble(char *file) } } - of = mycreate(outfile, 0664); + of = create(outfile, OWRITE, 0664); if(of < 0) { yyerror("%ca: cannot create %s", thechar, outfile); errorexit(); @@ -1044,9 +1060,9 @@ cinit(void) } pathname = allocn(pathname, 0, 100); - if(mygetwd(pathname, 99) == 0) { + if(getwd(pathname, 99) == 0) { pathname = allocn(pathname, 100, 900); - if(mygetwd(pathname, 999) == 0) + if(getwd(pathname, 999) == 0) strcpy(pathname, "/???"); } } |