mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
vac: plan9 compatibility
This commit is contained in:
parent
62e69a48c7
commit
948cc14e07
2 changed files with 9 additions and 6 deletions
|
@ -952,7 +952,6 @@ filemetaalloc(VacFile *fp, VacDir *dir, u32int start)
|
||||||
start = 0;
|
start = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
b = nil;
|
|
||||||
if(start > nb)
|
if(start > nb)
|
||||||
start = nb;
|
start = nb;
|
||||||
for(bo=start; bo<nb; bo++){
|
for(bo=start; bo<nb; bo++){
|
||||||
|
@ -969,7 +968,6 @@ filemetaalloc(VacFile *fp, VacDir *dir, u32int start)
|
||||||
goto Found;
|
goto Found;
|
||||||
}
|
}
|
||||||
vtblockput(b);
|
vtblockput(b);
|
||||||
b = nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No block found, extend the file by one metablock. */
|
/* No block found, extend the file by one metablock. */
|
||||||
|
@ -1179,7 +1177,6 @@ vacfileflush(VacFile *f, int recursive)
|
||||||
*/
|
*/
|
||||||
if(filelock(f) < 0)
|
if(filelock(f) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
fileunlock(f);
|
|
||||||
vtfilelock(f->source, -1);
|
vtfilelock(f->source, -1);
|
||||||
if(vtfileflush(f->source) < 0)
|
if(vtfileflush(f->source) < 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
@ -1304,7 +1301,7 @@ vacfilecreate(VacFile *fp, char *elem, ulong mode)
|
||||||
dir->ctime = dir->mtime;
|
dir->ctime = dir->mtime;
|
||||||
dir->atime = dir->mtime;
|
dir->atime = dir->mtime;
|
||||||
dir->mode = mode;
|
dir->mode = mode;
|
||||||
if((bo = filemetaalloc(fp, &ff->dir, NilBlock)) < 0)
|
if((bo = filemetaalloc(fp, &ff->dir, NilBlock)) == NilBlock)
|
||||||
goto Err;
|
goto Err;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
#include <fcall.h> /* dirmodefmt */
|
#include <fcall.h> /* dirmodefmt */
|
||||||
#include "vac.h"
|
#include "vac.h"
|
||||||
|
|
||||||
|
#ifndef PLAN9PORT
|
||||||
|
#pragma varargck type "t" ulong
|
||||||
|
#endif
|
||||||
|
|
||||||
VacFs *fs;
|
VacFs *fs;
|
||||||
int tostdout;
|
int tostdout;
|
||||||
int nwant;
|
int nwant;
|
||||||
|
@ -160,12 +164,13 @@ unvac(VacFile *f, char *name, VacDir *vdir)
|
||||||
mode9 = vdir->mode&0777;
|
mode9 = vdir->mode&0777;
|
||||||
if(mode&ModeDir)
|
if(mode&ModeDir)
|
||||||
mode9 |= DMDIR;
|
mode9 |= DMDIR;
|
||||||
if(mode&ModeLink)
|
|
||||||
mode9 |= DMSYMLINK;
|
|
||||||
if(mode&ModeAppend)
|
if(mode&ModeAppend)
|
||||||
mode9 |= DMAPPEND;
|
mode9 |= DMAPPEND;
|
||||||
if(mode&ModeExclusive)
|
if(mode&ModeExclusive)
|
||||||
mode9 |= DMEXCL;
|
mode9 |= DMEXCL;
|
||||||
|
#ifdef PLAN9PORT
|
||||||
|
if(mode&ModeLink)
|
||||||
|
mode9 |= DMSYMLINK;
|
||||||
if(mode&ModeNamedPipe)
|
if(mode&ModeNamedPipe)
|
||||||
mode9 |= DMNAMEDPIPE;
|
mode9 |= DMNAMEDPIPE;
|
||||||
if(mode&ModeSetUid)
|
if(mode&ModeSetUid)
|
||||||
|
@ -174,6 +179,7 @@ unvac(VacFile *f, char *name, VacDir *vdir)
|
||||||
mode9 |= DMSETGID;
|
mode9 |= DMSETGID;
|
||||||
if(mode&ModeDevice)
|
if(mode&ModeDevice)
|
||||||
mode9 |= DMDEVICE;
|
mode9 |= DMDEVICE;
|
||||||
|
#endif
|
||||||
print("%M %-10s %-10s %11lld %t %s\n",
|
print("%M %-10s %-10s %11lld %t %s\n",
|
||||||
mode9, vdir->uid, vdir->gid, vdir->size,
|
mode9, vdir->uid, vdir->gid, vdir->size,
|
||||||
vdir->mtime, name);
|
vdir->mtime, name);
|
||||||
|
|
Loading…
Reference in a new issue