shithub: riscv

Download patch

ref: 3d12f4f408da568dcb9cb0ba802dc9824cbe26fd
parent: 1b8fb4fec399dd9520db68b0c8e97d21881d639b
author: cinap_lenrek <[email protected]>
date: Sun Jun 8 14:27:39 EDT 2014

iostats: dont sysfatal on 9p read error due to program termination

the note mechanism is racy and can lead to the fs terminating
iostats because it gets "i/o on hugup channel" (namespace closed).

--- a/sys/src/cmd/iostats/iostats.c
+++ b/sys/src/cmd/iostats/iostats.c
@@ -166,10 +166,8 @@
 
 		while((n = read9pmsg(p[1], r->buf, sizeof(r->buf))) == 0 && !done)
 			;
-		if(done)
+		if(done || n < 0)
 			break;
-		if(n < 0)
-			fatal("read server");
 
 		if(convM2S(r->buf, n, &r->work) == 0)
 			fatal("format error");