diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/cmd/vac/vac.c | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/vac/vac.c')
-rw-r--r-- | src/cmd/vac/vac.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c index b54503e4..4555a907 100644 --- a/src/cmd/vac/vac.c +++ b/src/cmd/vac/vac.c @@ -15,7 +15,7 @@ usage(void) enum { BlockSize = 8*1024, - CacheSize = 4<<20, + CacheSize = 128<<20, }; struct @@ -48,7 +48,7 @@ static void removevacfile(void); #ifdef PLAN9PORT /* * We're between a rock and a hard place here. - * The pw library (getpwnam, etc.) reads the + * The pw library (getpwnam, etc.) reads the * password and group files into an on-stack buffer, * so if you have some huge groups, you overflow * the stack. Because of this, the thread library turns @@ -136,10 +136,10 @@ threadmain(int argc, char **argv) default: usage(); }ARGEND - + if(argc == 0 && !stdinname) usage(); - + if(archivefile && (vacfile || diffvac)){ fprint(2, "cannot use -a with -f, -d\n"); usage(); @@ -266,7 +266,7 @@ threadmain(int argc, char **argv) } if(fdiff) vacfiledecref(fdiff); - + /* * Record the maximum qid so that vacs can be merged * without introducing overlapping qids. Older versions @@ -313,7 +313,7 @@ recentarchive(VacFs *fs, char *path) char buf[10]; int year, mmdd, nn, n, n1; char *p; - + fp = vacfsgetroot(fs); de = vdeopen(fp); year = 0; @@ -339,7 +339,7 @@ recentarchive(VacFs *fs, char *path) return nil; } fp = f; - + de = vdeopen(fp); mmdd = 0; nn = 0; @@ -440,7 +440,7 @@ enum { /* * Archive the file named name, which has stat info d, - * into the vac directory fp (p = parent). + * into the vac directory fp (p = parent). * * If we're doing a vac -d against another archive, the * equivalent directory to fp in that archive is diffp. @@ -469,7 +469,7 @@ vac(VacFile *fp, VacFile *diffp, char *name, Dir *d) if(merge && vacmerge(fp, name) >= 0) return; - + if(verbose) fprint(2, "%s%s\n", name, (d->mode&DMDIR) ? "/" : ""); @@ -551,7 +551,7 @@ vac(VacFile *fp, VacFile *diffp, char *name, Dir *d) if(vacfilegetentries(fdiff, &e, nil) >= 0) if(vacfilesetentries(f, &e, nil) >= 0){ bsize = e.dsize; - + /* * Or if -q is set, and the metadata looks the same, * don't even bother reading the file. @@ -565,7 +565,7 @@ vac(VacFile *fp, VacFile *diffp, char *name, Dir *d) vdcleanup(&vddiff); goto Out; } - + /* * Skip over presumably-unchanged prefix * of an append-only file. @@ -631,7 +631,7 @@ vacstdin(VacFile *fp, char *name) warn("vacfilecreate %s: %r", name); return; } - + off = 0; while((n = read(0, buf, sizeof buf)) > 0){ if(vacfilewrite(f, buf, n, off) < 0){ @@ -660,7 +660,7 @@ vacmergefile(VacFile *fp, VacFile *mp, VacDir *d, char *vacfile, VtEntry ed, em; VacFile *mf; VacFile *f; - + mf = vacfilewalk(mp, d->elem); if(mf == nil){ warn("could not walk %s in %s", d->elem, vacfile); @@ -671,7 +671,7 @@ vacmergefile(VacFile *fp, VacFile *mp, VacDir *d, char *vacfile, vacfiledecref(mf); return -1; } - + if((f = vacfilecreate(fp, d->elem, d->mode)) == nil){ warn("vacfilecreate %s: %r", d->elem); vacfiledecref(mf); @@ -693,7 +693,7 @@ vacmergefile(VacFile *fp, VacFile *mp, VacDir *d, char *vacfile, vacfiledecref(f); return -1; } - + vacfiledecref(mf); vacfiledecref(f); return 0; @@ -778,4 +778,3 @@ warn(char *fmt, ...) fprint(2, "\n"); va_end(arg); } - |