summaryrefslogtreecommitdiff
path: root/acme/bin/source/win/fs.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-03-07 20:06:55 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-03-07 20:06:55 +0100
commite1cdcfdb172071bafef18b1ac160138c97459b79 (patch)
treec203ebb30f9c9d997af0e7cda3d0da72897a47ef /acme/bin/source/win/fs.c
parent022087cdcdd39e7904f6970b54152f4aa30fc071 (diff)
downloadplan9front-e1cdcfdb172071bafef18b1ac160138c97459b79.tar.xz
acme: split win into winfs and rc script, get rid of lib9p leavefdsopen hack
split the acme win command into a winfs fileserver which handles /dev/cons emulation and a rc script responsible for launching the command. with these changes, the fd fiddling is not neccesary anymore and we can get rid of the leavefdsopen hack.
Diffstat (limited to 'acme/bin/source/win/fs.c')
-rw-r--r--acme/bin/source/win/fs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/acme/bin/source/win/fs.c b/acme/bin/source/win/fs.c
index 9f2efe06e..473171e63 100644
--- a/acme/bin/source/win/fs.c
+++ b/acme/bin/source/win/fs.c
@@ -163,17 +163,24 @@ fsdestroyfid(Fid *fid)
free(fid->aux);
}
+void
+fsstart(Srv *srv)
+{
+ proccreate(fsloop, srv->aux, STACK);
+}
+
Srv fs = {
.read= fsread,
.write= fswrite,
.flush= fsflush,
.destroyfid= fsdestroyfid,
-.leavefdsopen= 1,
+.start = fsstart,
};
void
-mountcons(void)
+mountcons(void *arg)
{
+ fs.aux = arg;
fschan = chancreate(sizeof(Fsevent), 0);
writechan = chancreate(sizeof(void*), 0);
fs.tree = alloctree("win", "win", DMDIR|0555, nil);