aboutsummaryrefslogtreecommitdiff
path: root/src/lib9p
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-11 17:00:06 +0000
committerrsc <devnull@localhost>2005-02-11 17:00:06 +0000
commit2aa7d3036738bc548cfe6d8d83ff45cb1cb9c8c7 (patch)
treecfe386219b4eb911efd1be95989240a16faaae55 /src/lib9p
parentb589fce2fbf05ae18a6f015240f87ce2a163521f (diff)
downloadplan9port-2aa7d3036738bc548cfe6d8d83ff45cb1cb9c8c7.tar.gz
plan9port-2aa7d3036738bc548cfe6d8d83ff45cb1cb9c8c7.tar.bz2
plan9port-2aa7d3036738bc548cfe6d8d83ff45cb1cb9c8c7.zip
call srv->start at start
Diffstat (limited to 'src/lib9p')
-rw-r--r--src/lib9p/srv.c3
-rw-r--r--src/lib9p/tpost.c26
2 files changed, 22 insertions, 7 deletions
diff --git a/src/lib9p/srv.c b/src/lib9p/srv.c
index c5262f4c..2a300bbe 100644
--- a/src/lib9p/srv.c
+++ b/src/lib9p/srv.c
@@ -705,6 +705,9 @@ srv(Srv *srv)
srv->fpool->srv = srv;
srv->rpool->srv = srv;
+ if(srv->start)
+ srv->start(srv);
+
while(r = getreq(srv)){
if(r->error){
respond(r, r->error);
diff --git a/src/lib9p/tpost.c b/src/lib9p/tpost.c
index 68da19a7..337d2544 100644
--- a/src/lib9p/tpost.c
+++ b/src/lib9p/tpost.c
@@ -3,16 +3,28 @@
#include <fcall.h>
#include <thread.h>
#include <9p.h>
-#include "post.h"
+
+static void
+launchsrv(void *v)
+{
+ srv(v);
+}
void
threadpostmountsrv(Srv *s, char *name, char *mtpt, int flag)
{
- Postcrud *p;
+ int fd[2];
- p = _post1(s, name, mtpt, flag);
- if(procrfork(_post2, s, 32*1024, RFNAMEG|RFNOTEG) < 0)
- sysfatal("procrfork: %r");
- _post3(p);
-}
+ if(mtpt)
+ sysfatal("mount not supported");
+ if(!s->nopipe){
+ if(pipe(fd) < 0)
+ sysfatal("pipe: %r");
+ s->infd = s->outfd = fd[1];
+ s->srvfd = fd[0];
+ }
+ if(name && post9pservice(s->srvfd, name) < 0)
+ sysfatal("post9pservice %s: %r", name);
+ proccreate(launchsrv, s, 32*1024);
+}