diff options
| author | rsc <devnull@localhost> | 2004-02-29 22:10:26 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-02-29 22:10:26 +0000 |
| commit | 5a8e63b2f016735364d17866d5e2bcb35d20c78b (patch) | |
| tree | d5d0ce11e087efaf81c77311bac9d30aed41783d /src/cmd/acme/fsys.c | |
| parent | d51419bf4397cf13d0c50bf84c125477c6bed307 (diff) | |
| download | plan9port-5a8e63b2f016735364d17866d5e2bcb35d20c78b.tar.gz plan9port-5a8e63b2f016735364d17866d5e2bcb35d20c78b.zip | |
Fighting the good fight.
Move libfmt, libutf into subdirectories of lib9.
Add poll-based socket i/o to libthread, so that we can
avoid using multiple procs when possible, thus removing
dependence on crappy pthreads implementations.
Convert samterm, acme to the single-proc libthread.
Bring libcomplete, acme up-to-date w.r.t. Plan 9 distribution.
Diffstat (limited to 'src/cmd/acme/fsys.c')
| -rw-r--r-- | src/cmd/acme/fsys.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmd/acme/fsys.c b/src/cmd/acme/fsys.c index d220bdef..f178f864 100644 --- a/src/cmd/acme/fsys.c +++ b/src/cmd/acme/fsys.c @@ -111,8 +111,7 @@ void fsysinit(void) { int p[2]; - int n, fd; - char buf[256], *u; + char *u; if(pipe(p) < 0) error("can't create pipe"); @@ -122,7 +121,7 @@ fsysinit(void) fmtinstall('F', fcallfmt); if((u = getuser()) != nil) user = estrdup(u); - proccreate(fsysproc, nil, STACK); + threadcreate(fsysproc, nil, STACK); } void @@ -138,7 +137,7 @@ fsysproc(void *v) x = nil; for(;;){ buf = emalloc(messagesize+UTFmax); /* overflow for appending partial rune in xfidwrite */ - n = read9pmsg(sfd, buf, messagesize); + n = threadread9pmsg(sfd, buf, messagesize); if(n <= 0){ if(closing) break; @@ -255,7 +254,11 @@ respond(Xfid *x, Fcall *t, char *err) x->buf = emalloc(messagesize); n = convS2M(t, x->buf, messagesize); if(n <= 0) +{ +fprint(2, "convert error (n=%d, msgsize %d): have %F\n", n, messagesize, &x->fcall); +fprint(2, "\tresponse: %F\n", t); error("convert error in convS2M"); +} if(write(sfd, x->buf, n) != n) error("write error in respond"); free(x->buf); |
