aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vac
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-06-14 23:12:20 -0400
committerRuss Cox <rsc@swtch.com>2008-06-14 23:12:20 -0400
commit948cc14e076b2165b646f941e1e6a51be1590c4c (patch)
treeb9265f89c9c743396d51f3cf777f6139eb70819a /src/cmd/vac
parent62e69a48c7a6c5c2bc78b59be839977c3337dc56 (diff)
downloadplan9port-948cc14e076b2165b646f941e1e6a51be1590c4c.tar.gz
plan9port-948cc14e076b2165b646f941e1e6a51be1590c4c.tar.bz2
plan9port-948cc14e076b2165b646f941e1e6a51be1590c4c.zip
vac: plan9 compatibility
Diffstat (limited to 'src/cmd/vac')
-rw-r--r--src/cmd/vac/file.c5
-rw-r--r--src/cmd/vac/unvac.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/cmd/vac/file.c b/src/cmd/vac/file.c
index 035b2777..53cc95e3 100644
--- a/src/cmd/vac/file.c
+++ b/src/cmd/vac/file.c
@@ -952,7 +952,6 @@ filemetaalloc(VacFile *fp, VacDir *dir, u32int start)
start = 0;
}
- b = nil;
if(start > nb)
start = nb;
for(bo=start; bo<nb; bo++){
@@ -969,7 +968,6 @@ filemetaalloc(VacFile *fp, VacDir *dir, u32int start)
goto Found;
}
vtblockput(b);
- b = nil;
}
/* No block found, extend the file by one metablock. */
@@ -1179,7 +1177,6 @@ vacfileflush(VacFile *f, int recursive)
*/
if(filelock(f) < 0)
return -1;
- fileunlock(f);
vtfilelock(f->source, -1);
if(vtfileflush(f->source) < 0)
ret = -1;
@@ -1304,7 +1301,7 @@ vacfilecreate(VacFile *fp, char *elem, ulong mode)
dir->ctime = dir->mtime;
dir->atime = dir->mtime;
dir->mode = mode;
- if((bo = filemetaalloc(fp, &ff->dir, NilBlock)) < 0)
+ if((bo = filemetaalloc(fp, &ff->dir, NilBlock)) == NilBlock)
goto Err;
/*
diff --git a/src/cmd/vac/unvac.c b/src/cmd/vac/unvac.c
index 24165ae1..d9c21c46 100644
--- a/src/cmd/vac/unvac.c
+++ b/src/cmd/vac/unvac.c
@@ -2,6 +2,10 @@
#include <fcall.h> /* dirmodefmt */
#include "vac.h"
+#ifndef PLAN9PORT
+#pragma varargck type "t" ulong
+#endif
+
VacFs *fs;
int tostdout;
int nwant;
@@ -160,12 +164,13 @@ unvac(VacFile *f, char *name, VacDir *vdir)
mode9 = vdir->mode&0777;
if(mode&ModeDir)
mode9 |= DMDIR;
- if(mode&ModeLink)
- mode9 |= DMSYMLINK;
if(mode&ModeAppend)
mode9 |= DMAPPEND;
if(mode&ModeExclusive)
mode9 |= DMEXCL;
+#ifdef PLAN9PORT
+ if(mode&ModeLink)
+ mode9 |= DMSYMLINK;
if(mode&ModeNamedPipe)
mode9 |= DMNAMEDPIPE;
if(mode&ModeSetUid)
@@ -174,6 +179,7 @@ unvac(VacFile *f, char *name, VacDir *vdir)
mode9 |= DMSETGID;
if(mode&ModeDevice)
mode9 |= DMDEVICE;
+#endif
print("%M %-10s %-10s %11lld %t %s\n",
mode9, vdir->uid, vdir->gid, vdir->size,
vdir->mtime, name);