code: plan9front

Download patch

ref: b48078c12cdf0e3b718e38102b7548c14bed33a4
parent: 47f05d4d8b2c9f12aa77a73536f98d05c9494291
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jun 18 18:58:56 EDT 2015

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.

--- a/sys/src/9/port/swap.c
+++ b/sys/src/9/port/swap.c
@@ -149,6 +149,10 @@
 	Segment *s;
 	Proc *p, *ep;
 
+	cclose(up->dot);
+	up->dot = up->slash;
+	incref(up->dot);
+
 	p = proctab(0);
 	ep = &p[conf.nproc];