summaryrefslogtreecommitdiff
path: root/sys/src/9/port/swap.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-06-18 22:58:56 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-06-18 22:58:56 +0200
commitb48078c12cdf0e3b718e38102b7548c14bed33a4 (patch)
tree6798bee887a5536acfb4fbd0b0067de576acbcd1 /sys/src/9/port/swap.c
parent47f05d4d8b2c9f12aa77a73536f98d05c9494291 (diff)
kernel: do not inherit current directory channel (dot) to pager
kproc() inherits dot and slash, pager needs to drop these channels, otherwise it will keep the files open preventing say, ramfs to exit.
Diffstat (limited to 'sys/src/9/port/swap.c')
-rw-r--r--sys/src/9/port/swap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/9/port/swap.c b/sys/src/9/port/swap.c
index 73d12345a..efbf3cbb4 100644
--- a/sys/src/9/port/swap.c
+++ b/sys/src/9/port/swap.c
@@ -149,6 +149,10 @@ pager(void*)
Segment *s;
Proc *p, *ep;
+ cclose(up->dot);
+ up->dot = up->slash;
+ incref(up->dot);
+
p = proctab(0);
ep = &p[conf.nproc];