diff --git a/sys/src/cmd/gefs/fs.c b/sys/src/cmd/gefs/fs.c index 9b91e450a..b70c35d25 100644 --- a/sys/src/cmd/gefs/fs.c +++ b/sys/src/cmd/gefs/fs.c @@ -2026,7 +2026,7 @@ readsnap(Fmsg *m, Fid *f, Fcall *r) } if(s->donescan){ r->count = 0; - return; + goto Out; } p = r->data; n = m->count; @@ -2037,7 +2037,7 @@ readsnap(Fmsg *m, Fid *f, Fcall *r) d.qid.path = UNPACK64(s->kv.v + 1); if((ns = dir2statbuf(&d, p, n)) == -1){ r->count = 0; - return; + goto Out; } s->overflow = 0; p += ns; @@ -2058,9 +2058,11 @@ readsnap(Fmsg *m, Fid *f, Fcall *r) n -= ns; } btexit(s); + r->count = p - r->data; + +Out: poperror(); wunlock(f); - r->count = p - r->data; return; }