mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
devmnt: deal with partial response for Tversion request in mntversion()
This commit is contained in:
parent
61dea9012e
commit
b450cb7e32
1 changed files with 8 additions and 8 deletions
|
@ -164,7 +164,6 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
|
|||
unlock(c);
|
||||
|
||||
l = devtab[c->type]->write(c, msg, k, oo);
|
||||
|
||||
if(l < k){
|
||||
lock(c);
|
||||
c->offset -= k - l;
|
||||
|
@ -173,13 +172,14 @@ mntversion(Chan *c, char *version, int msize, int returnlen)
|
|||
}
|
||||
|
||||
/* message sent; receive and decode reply */
|
||||
k = devtab[c->type]->read(c, msg, 8192+IOHDRSZ, c->offset);
|
||||
if(k <= 0)
|
||||
error("EOF receiving fversion reply");
|
||||
|
||||
lock(c);
|
||||
c->offset += k;
|
||||
unlock(c);
|
||||
for(k = 0; k < BIT32SZ || (k < GBIT32(msg) && k < 8192+IOHDRSZ); k += l){
|
||||
l = devtab[c->type]->read(c, msg+k, 8192+IOHDRSZ-k, c->offset);
|
||||
if(l <= 0)
|
||||
error("EOF receiving fversion reply");
|
||||
lock(c);
|
||||
c->offset += l;
|
||||
unlock(c);
|
||||
}
|
||||
|
||||
l = convM2S(msg, k, &f);
|
||||
if(l != k)
|
||||
|
|
Loading…
Reference in a new issue