From 3d12f4f408da568dcb9cb0ba802dc9824cbe26fd Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 8 Jun 2014 18:27:39 +0200 Subject: 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). --- sys/src/cmd/iostats/iostats.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/src/cmd/iostats/iostats.c b/sys/src/cmd/iostats/iostats.c index 61b16ea4b..e65c7c83b 100644 --- a/sys/src/cmd/iostats/iostats.c +++ b/sys/src/cmd/iostats/iostats.c @@ -166,10 +166,8 @@ main(int argc, char **argv) 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"); -- cgit v1.2.3