diff options
| -rw-r--r-- | sys/man/2/thread | 5 | ||||
| -rw-r--r-- | sys/src/libthread/exec.c | 16 | ||||
| -rw-r--r-- | sys/src/libthread/main.c | 1 |
3 files changed, 6 insertions, 16 deletions
diff --git a/sys/man/2/thread b/sys/man/2/thread index b06e31b96..3b93eef9e 100644 --- a/sys/man/2/thread +++ b/sys/man/2/thread @@ -356,11 +356,6 @@ can safely free it once they have received the .I cpid response. -Note that the mount point -.B /mnt/temp -must exist; -.I procexec(l) -mount pipes there. .PP .I Threadwaitchan returns a channel of pointers to diff --git a/sys/src/libthread/exec.c b/sys/src/libthread/exec.c index b93eeb28f..3bfbda3c6 100644 --- a/sys/src/libthread/exec.c +++ b/sys/src/libthread/exec.c @@ -3,8 +3,6 @@ #include <thread.h> #include "threadimpl.h" -#define PIPEMNT "/mnt/temp" - void procexec(Channel *pidc, char *prog, char *args[]) { @@ -36,18 +34,16 @@ procexec(Channel *pidc, char *prog, char *args[]) * then the proc doing the exec sends the errstr down the * pipe to us. */ - if(bind("#|", PIPEMNT, MREPL) < 0) - goto Bad; - if((p->exec.fd[0] = open(PIPEMNT "/data", OREAD)) < 0){ - unmount(nil, PIPEMNT); + if(pipe(p->exec.fd) < 0) goto Bad; - } - if((p->exec.fd[1] = open(PIPEMNT "/data1", OWRITE|OCEXEC)) < 0){ + snprint(p->exitstr, ERRMAX, "/fd/%d", p->exec.fd[1]); + if((n = open(p->exitstr, OWRITE|OCEXEC)) < 0){ close(p->exec.fd[0]); - unmount(nil, PIPEMNT); + close(p->exec.fd[1]); goto Bad; } - unmount(nil, PIPEMNT); + close(p->exec.fd[1]); + p->exec.fd[1] = n; /* exec in parallel via the scheduler */ assert(p->needexec==0); diff --git a/sys/src/libthread/main.c b/sys/src/libthread/main.c index 03c069c14..708b65ed1 100644 --- a/sys/src/libthread/main.c +++ b/sys/src/libthread/main.c @@ -114,7 +114,6 @@ efork(Execargs *e) if(buf[0]=='\0') strcpy(buf, "exec failed"); write(e->fd[1], buf, strlen(buf)); - close(e->fd[1]); _exits(buf); } |
