mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
gefs: fix error handling in readsnap()
This commit is contained in:
parent
d4938f099d
commit
0bfa3ffcb4
1 changed files with 5 additions and 3 deletions
|
@ -2026,7 +2026,7 @@ readsnap(Fmsg *m, Fid *f, Fcall *r)
|
||||||
}
|
}
|
||||||
if(s->donescan){
|
if(s->donescan){
|
||||||
r->count = 0;
|
r->count = 0;
|
||||||
return;
|
goto Out;
|
||||||
}
|
}
|
||||||
p = r->data;
|
p = r->data;
|
||||||
n = m->count;
|
n = m->count;
|
||||||
|
@ -2037,7 +2037,7 @@ readsnap(Fmsg *m, Fid *f, Fcall *r)
|
||||||
d.qid.path = UNPACK64(s->kv.v + 1);
|
d.qid.path = UNPACK64(s->kv.v + 1);
|
||||||
if((ns = dir2statbuf(&d, p, n)) == -1){
|
if((ns = dir2statbuf(&d, p, n)) == -1){
|
||||||
r->count = 0;
|
r->count = 0;
|
||||||
return;
|
goto Out;
|
||||||
}
|
}
|
||||||
s->overflow = 0;
|
s->overflow = 0;
|
||||||
p += ns;
|
p += ns;
|
||||||
|
@ -2058,9 +2058,11 @@ readsnap(Fmsg *m, Fid *f, Fcall *r)
|
||||||
n -= ns;
|
n -= ns;
|
||||||
}
|
}
|
||||||
btexit(s);
|
btexit(s);
|
||||||
|
r->count = p - r->data;
|
||||||
|
|
||||||
|
Out:
|
||||||
poperror();
|
poperror();
|
||||||
wunlock(f);
|
wunlock(f);
|
||||||
r->count = p - r->data;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue