summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rc/havefork.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-09-08 14:49:00 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-09-08 14:49:00 +0200
commit2839760066e578e449ebc8b3d71297b9f79a8c99 (patch)
tree95cae2887eaa016a1d9e2205420342e881bbddb0 /sys/src/cmd/rc/havefork.c
parent217e8a06198cf6681fb0c38c26f34d96ae4302f6 (diff)
rc: fix Xpipefd unbalancing the redir stack
Xpipefd wants the pipe descriptor to be closed in turfredir(), so it pushes the redirection, but this breaks Xpopredir after normal redirection. so we shuffle the Xpipefd redir to the bottom of the stack.
Diffstat (limited to 'sys/src/cmd/rc/havefork.c')
-rw-r--r--sys/src/cmd/rc/havefork.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/cmd/rc/havefork.c b/sys/src/cmd/rc/havefork.c
index ad5a80298..86d6c91f6 100644
--- a/sys/src/cmd/rc/havefork.c
+++ b/sys/src/cmd/rc/havefork.c
@@ -185,7 +185,8 @@ Xpipefd(void)
default:
addwaitpid(pid);
close(sidefd);
- pushredir(ROPEN, mainfd, mainfd); /* isn't this a noop? */
+ pushredir(ROPEN, mainfd, mainfd);
+ shuffleredir(); /* shuffle redir to bottom of stack for turfredir() */
strcpy(name, Fdprefix);
inttoascii(name+strlen(name), mainfd);
pushword(name);