diff options
author | Marius Eriksen <marius.eriksen@gmail.com> | 2012-10-21 16:52:08 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2012-10-21 16:52:08 -0400 |
commit | 81c2c5e775d83896f25981cf4c4e486c5cc91180 (patch) | |
tree | 6d18605ca470aae3d05deb040aad47d7e2fe4195 /src/cmd/acme/exec.c | |
parent | 9c611279288ca016aeb214da4a23a8e2cce45027 (diff) | |
download | plan9port-81c2c5e775d83896f25981cf4c4e486c5cc91180.tar.gz plan9port-81c2c5e775d83896f25981cf4c4e486c5cc91180.tar.bz2 plan9port-81c2c5e775d83896f25981cf4c4e486c5cc91180.zip |
acme: add $acmeshell to control execution shell
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6614056
Diffstat (limited to 'src/cmd/acme/exec.c')
-rw-r--r-- | src/cmd/acme/exec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index 8262be4a..81a2fcd9 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -1358,6 +1358,7 @@ runproc(void *argvp) char *rcarg[4]; void **argv; CFsys *fs; + char *shell; threadsetname("runproc"); @@ -1467,6 +1468,8 @@ runproc(void *argvp) if(argaddr) putenv("acmeaddr", argaddr); + if(acmeshell != nil) + goto Hard; if(strlen(t) > sizeof buf-10) /* may need to print into stack */ goto Hard; inarg = FALSE; @@ -1576,7 +1579,10 @@ Hard: chdir(dir); /* ignore error: probably app. window */ free(dir); } - rcarg[0] = "rc"; + shell = acmeshell; + if(shell == nil) + shell = "rc"; + rcarg[0] = shell; rcarg[1] = "-c"; rcarg[2] = t; rcarg[3] = nil; @@ -1590,7 +1596,7 @@ Hard: sendul(cpid, ret); threadexits(nil); } - warning(nil, "exec rc: %r\n"); + warning(nil, "exec %s: %r\n", shell); Fail: /* threadexec hasn't happened, so send a zero */ |