diff options
author | rsc <devnull@localhost> | 2004-12-28 01:45:05 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-12-28 01:45:05 +0000 |
commit | 22c7ebffdade6036f5b46347f6a6ca41023c6253 (patch) | |
tree | 78841d3f6de1a3231dcb9abf459136472a92bed5 /src/cmd/sam | |
parent | 7ffc5208a82cd7339c125956a9702ac08c0ff2f4 (diff) | |
download | plan9port-22c7ebffdade6036f5b46347f6a6ca41023c6253.tar.gz plan9port-22c7ebffdade6036f5b46347f6a6ca41023c6253.tar.bz2 plan9port-22c7ebffdade6036f5b46347f6a6ca41023c6253.zip |
more little compile fixes
Diffstat (limited to 'src/cmd/sam')
-rw-r--r-- | src/cmd/sam/sam.h | 3 | ||||
-rw-r--r-- | src/cmd/sam/unix.c | 20 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/cmd/sam/sam.h b/src/cmd/sam/sam.h index 1ab2b495..0641be81 100644 --- a/src/cmd/sam/sam.h +++ b/src/cmd/sam/sam.h @@ -3,6 +3,9 @@ #include <plumb.h> #include "errors.h" +#undef waitfor +#define waitfor samwaitfor + /* * BLOCKSIZE is relatively small to keep memory consumption down. */ diff --git a/src/cmd/sam/unix.c b/src/cmd/sam/unix.c index 162ba74f..2505f854 100644 --- a/src/cmd/sam/unix.c +++ b/src/cmd/sam/unix.c @@ -177,16 +177,20 @@ tempdisk(void) return fd; } -#undef wait +#undef waitfor int -waitfor(int pid) +samwaitfor(int pid) { - int wm; - int rpid; - - do; while((rpid = wait(&wm)) != pid && rpid != -1); - return (WEXITSTATUS(wm)); -} + int r; + Waitmsg *w; + + w = p9waitfor(pid); + if(w == nil) + return -1; + r = atoi(w->msg); + free(w); + return r; +} void samerr(char *buf) |