aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vac
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-07-02 15:39:13 -0400
committerRuss Cox <rsc@swtch.com>2008-07-02 15:39:13 -0400
commit9b3ac170501c1f1b50a8e7eaf39d68653b3bd72d (patch)
treef9cef604fb349d68021fc7edcf5b06afd92f927b /src/cmd/vac
parenta1b61b4635adf4e070fdf91e3a512d94195214cd (diff)
downloadplan9port-9b3ac170501c1f1b50a8e7eaf39d68653b3bd72d.tar.gz
plan9port-9b3ac170501c1f1b50a8e7eaf39d68653b3bd72d.tar.bz2
plan9port-9b3ac170501c1f1b50a8e7eaf39d68653b3bd72d.zip
vac: fix -m bug (Myron Cheung)
Diffstat (limited to 'src/cmd/vac')
-rw-r--r--src/cmd/vac/file.c3
-rw-r--r--src/cmd/vac/vac.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/cmd/vac/file.c b/src/cmd/vac/file.c
index 407ccd81..f5f823d7 100644
--- a/src/cmd/vac/file.c
+++ b/src/cmd/vac/file.c
@@ -408,7 +408,6 @@ dirlookup(VacFile *f, char *elem)
filefree(ff);
goto Err;
}
-fprint(2, "offset %s %lld\n", ff->dir.elem, ff->dir.qidoffset);
ff->qidoffset = f->qidoffset + ff->dir.qidoffset;
vtfileunlock(meta);
vtblockput(b);
@@ -664,7 +663,7 @@ vacfilegetentries(VacFile *f, VtEntry *e, VtEntry *me)
if(me){
if(f->msource == nil)
memset(me, 0, sizeof *me);
- if(getentry(f->msource, me) < 0){
+ else if(getentry(f->msource, me) < 0){
filerunlock(f);
return -1;
}
diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c
index e97951b8..183fa380 100644
--- a/src/cmd/vac/vac.c
+++ b/src/cmd/vac/vac.c
@@ -616,9 +616,9 @@ vacmerge(VacFile *fp, char *name)
if(verbose)
fprint(2, "merging %s\n", name);
- de = vdeopen(fs->root);
+ mp = vacfsgetroot(mfs);
+ de = vdeopen(mp);
if(de){
- mp = vacfsgetroot(mfs);
offset = 0;
if(vacfsgetmaxqid(mfs, &maxqid) >= 0){
_vacfsnextqid(fs, &offset);
@@ -636,8 +636,8 @@ vacmerge(VacFile *fp, char *name)
vdcleanup(&vd);
}
vdeclose(de);
- vacfiledecref(mp);
}
+ vacfiledecref(mp);
vacfsclose(mfs);
return 0;
}