shithub: riscv

Download patch

ref: 19162849bd5986f01034f04172f52386d7e961b2
parent: 87160cbfcf926fd0a9f04e8113a16c2a0c7e252d
author: Jacob Moody <moody@posixcafe.org>
date: Sat Sep 10 23:38:55 EDT 2022

rio: more pointy edges with none attach

Would crash when reading from wctl in riostart.

--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -293,7 +293,7 @@
 			ntsnarf = 0;
 		break;
 	case Qwctl:
-		if(x->mode==OREAD || x->mode==ORDWR){
+		if(w != nil && (x->mode==OREAD || x->mode==ORDWR)){
 			/*
 			 * It would be much nicer to implement fan-out for wctl reads,
 			 * so multiple people can see the resizings, but rio just isn't
@@ -365,7 +365,7 @@
 		}
 		break;
 	case Qwctl:
-		if(x->f->mode==OREAD || x->f->mode==ORDWR)
+		if(w != nil && (x->f->mode==OREAD || x->f->mode==ORDWR))
 			w->wctlopen = FALSE;
 		break;
 	case Qtap: