shithub: riscv

Download patch

ref: e2d6d402f1a4a063b3549cb2e988a6e978858579
parent: ed06d703439b70bdc4c5ff96d0d3749ccb8566c9
author: Jacob Moody <moody@posixcafe.org>
date: Sun Sep 11 16:50:46 EDT 2022

rio: return 'global' size for none /dev/wctl read (thanks umbraticus)

Before we were just erroring, this provides something useful giving
the total size of the rio to the riostart script.

--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -657,8 +657,14 @@
 	switch(qid){
 	case Qwctl:
 		if(w == nil){
-			filsysrespond(x->fs, x, &fc, "no window");
-			return;
+			if(off >= 6*12){
+				filsysrespond(x->fs, x, &fc, "no window");
+				return;
+			}
+			n = sprint(buf, "%11d %11d %11d %11d nowindow    nowindow    ",
+				screen->r.min.x, screen->r.min.y, screen->r.max.x, screen->r.max.y);
+			t = estrdup(buf);
+			goto Text;
 		}
 		if(cnt < 4*12){
 			filsysrespond(x->fs, x, &fc, Etooshort);