shithub: riscv

Download patch

ref: 5a5318473e00aa854d00573abba1725af7b140dd
parent: 4009eb2feecfa4722d5cb22be4f5db9f26d15be3
author: Jacob Moody <moody@posixcafe.org>
date: Fri Aug 19 22:41:10 EDT 2022

rio: /dev/label should just ignore offset

We were erroring if offset != 0. Just ignore
the offset.

--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -376,7 +376,7 @@
 xfidwrite(Xfid *x)
 {
 	Fcall fc;
-	int cnt, qid, nb, off, nr;
+	int cnt, qid, nb, nr;
 	char err[ERRMAX], *p, *e;
 	Point pt;
 	Window *w;
@@ -393,7 +393,6 @@
 	}
 	qid = FILE(x->f->qid);
 	cnt = x->count;
-	off = x->offset;
 	x->data[cnt] = 0;
 	switch(qid){
 	case Qcons:
@@ -494,10 +493,6 @@
 		break;
 
 	case Qlabel:
-		if(off != 0){
-			filsysrespond(x->fs, x, &fc, "non-zero offset writing label");
-			return;
-		}
 		p = realloc(w->label, cnt+1);
 		if(p == nil){
 			filsysrespond(x->fs, x, &fc, Enomem);