git: 9front

Download patch

ref: 6f2948d1141bead4cd4c525d751819c5e01a8611
parent: 54cbf2feba92191798d5d2a3c2f996726eddd049
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun May 26 21:09:34 EDT 2013

kernel: closechanq error

catch potential interrupt error from kproc(). this can happen when
we run out of processes, then newproc() will call rsrcwait()
which does tsleep(). if the process gets a note, this might
raise a interrupt error.

--- a/sys/src/9/port/chan.c
+++ b/sys/src/9/port/chan.c
@@ -536,7 +536,10 @@
 	if(up != 0 && palloc.Lock.p != up && canqlock(&clunkq.q)){
 		c = up->dot;
 		up->dot = nil;
-		kproc("closeproc", closeproc, nil);
+		if(!waserror()){
+			kproc("closeproc", closeproc, nil);
+			poperror();
+		}
 		up->dot = c;
 	}else
 		wakeup(&clunkq.r);
--