shithub: fork

Download patch

ref: 530bc158c8015ef54da4cd3524da83516fd2a786
parent: e3583a0837891ab2059b91f6500c88baf34982dc
author: qwx <qwx@sciops.net>
date: Sat Oct 14 23:56:49 EDT 2023

bar: sync

--- a/sys/src/cmd/bar.c
+++ b/sys/src/cmd/bar.c
@@ -196,16 +196,16 @@
 static void
 auxproc(void *c)
 {
-	Biobuf b;
+	u8int buf[1024];
+	Biobufhdr b;
 	char *s;
 
 	threadsetname("aux");
-	Binit(&b, 0, OREAD);
+	Binits(&b, 0, OREAD, buf, sizeof(buf));
 	for(;;){
-		s = Brdstr(&b, '\n', 1);
+		sendp(c, s = Brdstr(&b, '\n', 1));
 		if(s == nil)
 			break;
-		sendp(c, s);
 	}
 	Bterm(&b);
 
@@ -316,7 +316,7 @@
 	readbattery();
 	redraw();
 	proccreate(timerproc, a[Etimer].c, 4096);
-	proccreate(auxproc, a[Eaux].c, 16384);
+	proccreate(auxproc, a[Eaux].c, 4096);
 
 	m.buttons = 0;
 	oldt = nanosec();
@@ -352,6 +352,8 @@
 		case Eaux:
 			free(aux);
 			aux = s;
+			if(aux == nil)
+				threadexitsall(nil);
 			/* wet floor */
 		}