~kris/9p

9hist

11318456a3650ed8bd91e7a021bd7eb2af5779f2 — David du Colombier 28 years ago 4c3ee00
Plan 9 from Bell Labs 1998-09-08
1 files changed, 5 insertions(+), 4 deletions(-)

M port/devmnt.c
M port/devmnt.c => port/devmnt.c +5 -4
@@ 573,7 573,7 @@ mntrdwr(int type, Chan *c, void *buf, long n, vlong off)
 	Mntrpc *r;
	char *uba;
	int cache;
	ulong cnt, nr;
	ulong cnt, nr, nreq;

	m = mntchk(c);
	uba = buf;


@@ 593,9 593,10 @@ mntrdwr(int type, Chan *c, void *buf, long n, vlong off)
		r->request.data = uba;
		r->request.count = limit(n, m->blocksize);
		mountrpc(m, r);
		nreq = r->request.count;
		nr = r->reply.count;
		if(nr > r->request.count)
			nr = r->request.count;
		if(nr > nreq)
			nr = nreq;

		if(type == Tread)
			memmove(uba, r->reply.data, nr);


@@ 608,7 609,7 @@ mntrdwr(int type, Chan *c, void *buf, long n, vlong off)
		uba += nr;
		cnt += nr;
		n -= nr;
		if(nr != r->request.count || n == 0 || up->nnote)
		if(nr != nreq || n == 0 || up->nnote)
			break;
	}
	return cnt;