From 22c7ebffdade6036f5b46347f6a6ca41023c6253 Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 28 Dec 2004 01:45:05 +0000 Subject: more little compile fixes --- src/cmd/sam/sam.h | 3 +++ src/cmd/sam/unix.c | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src/cmd/sam') 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 #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) -- cgit v1.2.3