summaryrefslogtreecommitdiffstats
path: root/src/libthread/exec-unix.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2003-11-23 18:18:41 +0000
committerrsc <devnull@localhost>2003-11-23 18:18:41 +0000
commit8a708fb239f4272ac7e4f16f437093c56b2cab39 (patch)
treeca0d390ac36375519a50a0dec32ca3ce6cff8b68 /src/libthread/exec-unix.c
parentcd7ddc9b5f34da33a2eb0ea761681c2330284e69 (diff)
downloadplan9port-8a708fb239f4272ac7e4f16f437093c56b2cab39.tar.gz
plan9port-8a708fb239f4272ac7e4f16f437093c56b2cab39.zip
sun support
Diffstat (limited to 'src/libthread/exec-unix.c')
-rw-r--r--src/libthread/exec-unix.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/libthread/exec-unix.c b/src/libthread/exec-unix.c
index 6e4f7289..5a37e34c 100644
--- a/src/libthread/exec-unix.c
+++ b/src/libthread/exec-unix.c
@@ -9,13 +9,11 @@ procexec(Channel *pidc, char *prog, char *args[])
Proc *p;
Thread *t;
-print("procexec\n");
_threaddebug(DBGEXEC, "procexec %s", prog);
/* must be only thread in proc */
p = _threadgetproc();
t = p->thread;
if(p->threads.head != t || p->threads.head->nextt != nil){
-print("not only thread\n");
werrstr("not only thread in proc");
Bad:
if(pidc)
@@ -36,35 +34,26 @@ print("not only thread\n");
* pipe to us.
*/
if(pipe(p->exec.fd) < 0)
-{
-print("pipe\n");
goto Bad;
-}
if(fcntl(p->exec.fd[1], F_SETFD, 1) < 0)
-{
-print("fcntl\n");
goto Bad;
-}
/* exec in parallel via the scheduler */
assert(p->needexec==0);
p->exec.prog = prog;
p->exec.args = args;
p->needexec = 1;
-print("sched\n");
_sched();
close(p->exec.fd[1]);
if((n = read(p->exec.fd[0], p->exitstr, ERRMAX-1)) > 0){ /* exec failed */
p->exitstr[n] = '\0';
-print("read got %s\n", p->exitstr);
errstr(p->exitstr, ERRMAX);
close(p->exec.fd[0]);
goto Bad;
}
close(p->exec.fd[0]);
-print("exec %d\n", pidc);
if(pidc)
sendul(pidc, t->ret);