From de64b9c37ab2afc490cfb649a023a5d06454f969 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 3 Nov 1993 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1993-11-03 --- port/cache.c | 3 ++- port/devmnt.c | 8 ++------ port/qio.c | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/port/cache.c b/port/cache.c index 936dffa6ab25ceddf981af25bdef46de128fd3bc..307775b14341e4d842afd38bd064887d33bad732 100644 --- a/port/cache.c +++ b/port/cache.c @@ -80,6 +80,7 @@ cprint(Chan *c, Mntcache *m, char *s) ptpath(c->path, buf, sizeof(buf)); nb = 0; ct = 1; + o = 0; if(m->list) o = m->list->start; for(e = m->list; e; e = e->next) { @@ -92,7 +93,7 @@ cprint(Chan *c, Mntcache *m, char *s) s, m->path, m->vers, m->type, m->dev, buf, nb, ct ? 'C' : 'N'); for(e = m->list; e; e = e->next) { - if(0) pprint("\t%4d %5d %4d %lux\n", + pprint("\t%4d %5d %4d %lux\n", e->bid, e->start, e->len, e->cache); } } diff --git a/port/devmnt.c b/port/devmnt.c index 71ebb4597cf39185d81103bd5506aed158a14fa7..15b2c22a5ac2542bd6080cd32e200f925a833a35 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -667,9 +667,8 @@ mountio(Mnt *m, Mntrpc *r) void mntrpcread(Mnt *m, Mntrpc *r) { - int n, zrd; + int n; - zrd = 0; for(;;) { if(waserror()) { if(mntflush(m, r) == 0) { @@ -683,11 +682,8 @@ mntrpcread(Mnt *m, Mntrpc *r) r->reply.tag = 0; n = (*devtab[m->c->type].read)(m->c, r->rpc, MAXRPC, 0); poperror(); - if(n == 0) { - if(++zrd > 3) - error(Ehungup); + if(n == 0) continue; - } if(convM2S(r->rpc, &r->reply, n) != 0) return; diff --git a/port/qio.c b/port/qio.c index ffd92f3c08ff52c13a4738e1460e7d63908446d4..e0dbf549e8081ef23c58c7911a17f26f208474d0 100644 --- a/port/qio.c +++ b/port/qio.c @@ -365,7 +365,7 @@ qproduce(Queue *q, void *vp, int len) b = iallocb(len); if(b == 0){ unlock(q); - return -1; + return -2; } memmove(b->wp, p, len); b->wp += len;