aboutsummaryrefslogtreecommitdiff
path: root/src/lib9p
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-05-05 23:06:39 -0400
committerRuss Cox <rsc@swtch.com>2008-05-05 23:06:39 -0400
commitce1e3a796ccce89dd284dab916ec5b83a03fdcf8 (patch)
treefd73ee0cb5b946de63a62e8214d675159e5d3b6c /src/lib9p
parent3c8afaf281cc0d7123abb47222270ad8c05545cb (diff)
downloadplan9port-ce1e3a796ccce89dd284dab916ec5b83a03fdcf8.tar.gz
plan9port-ce1e3a796ccce89dd284dab916ec5b83a03fdcf8.tar.bz2
plan9port-ce1e3a796ccce89dd284dab916ec5b83a03fdcf8.zip
lib9p: make ramfs build
Diffstat (limited to 'src/lib9p')
-rw-r--r--src/lib9p/ramfs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib9p/ramfs.c b/src/lib9p/ramfs.c
index e476e795..b7a07c7d 100644
--- a/src/lib9p/ramfs.c
+++ b/src/lib9p/ramfs.c
@@ -59,7 +59,7 @@ fswrite(Req *r)
}
rf->data = v;
rf->ndata = offset+count;
- r->fid->file->length = rf->ndata;
+ r->fid->file->dir.length = rf->ndata;
}
memmove(rf->data+offset, r->ifcall.data, count);
r->ofcall.count = count;
@@ -76,7 +76,7 @@ fscreate(Req *r)
rf = emalloc9p(sizeof *rf);
f->aux = rf;
r->fid->file = f;
- r->ofcall.qid = f->qid;
+ r->ofcall.qid = f->dir.qid;
respond(r, nil);
return;
}
@@ -92,7 +92,7 @@ fsopen(Req *r)
if(rf && (r->ifcall.mode&OTRUNC)){
rf->ndata = 0;
- r->fid->file->length = 0;
+ r->fid->file->dir.length = 0;
}
respond(r, nil);
@@ -122,18 +122,18 @@ void
usage(void)
{
fprint(2, "usage: ramfs [-D] [-s srvname] [-m mtpt]\n");
- exits("usage");
+ threadexitsall("usage");
}
void
-main(int argc, char **argv)
+threadmain(int argc, char **argv)
{
char *srvname = nil;
char *mtpt = nil;
Qid q;
fs.tree = alloctree(nil, nil, DMDIR|0777, fsdestroyfile);
- q = fs.tree->root->qid;
+ q = fs.tree->root->dir.qid;
ARGBEGIN{
case 'D':
@@ -157,6 +157,6 @@ main(int argc, char **argv)
if(srvname == nil && mtpt == nil)
sysfatal("you should at least specify a -s or -m option");
- postmountsrv(&fs, srvname, mtpt, MREPL|MCREATE);
- exits(0);
+ threadpostmountsrv(&fs, srvname, mtpt, MREPL|MCREATE);
+ threadexits(0);
}