diff options
author | rsc <devnull@localhost> | 2005-01-27 20:36:04 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-27 20:36:04 +0000 |
commit | 07494878dc5ae11652cbe221cf9e2a20da94ca96 (patch) | |
tree | b450c924a2bdb8c856f23cead69eecf9f4627875 /src/cmd | |
parent | c91cfa9177ba734a4906dce29810845d3557650c (diff) | |
download | plan9port-07494878dc5ae11652cbe221cf9e2a20da94ca96.tar.gz plan9port-07494878dc5ae11652cbe221cf9e2a20da94ca96.tar.bz2 plan9port-07494878dc5ae11652cbe221cf9e2a20da94ca96.zip |
remove searching print; check fids in use; handle addr correctly again
Diffstat (limited to 'src/cmd')
-rw-r--r-- | src/cmd/acme/addr.c | 1 | ||||
-rw-r--r-- | src/cmd/acme/fsys.c | 18 | ||||
-rw-r--r-- | src/cmd/acme/xfid.c | 8 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/cmd/acme/addr.c b/src/cmd/acme/addr.c index 4e31d6ae..7af5f6be 100644 --- a/src/cmd/acme/addr.c +++ b/src/cmd/acme/addr.c @@ -138,7 +138,6 @@ regexp(uint showerr, Text *t, Range lim, Range r, Rune *pat, int dir, int *found q = Infinity; else q = lim.q1; -warning(nil, "searching %d-%d\n", r.q1, q); found = rxexecute(t, nil, r.q1, q, &sel); } if(!found && showerr) diff --git a/src/cmd/acme/fsys.c b/src/cmd/acme/fsys.c index 66b935f8..536a3334 100644 --- a/src/cmd/acme/fsys.c +++ b/src/cmd/acme/fsys.c @@ -160,10 +160,24 @@ fsysproc(void *v) if(fcall[x->fcall.type] == 0) x = respond(x, &t, "bad fcall type"); else{ - if(x->fcall.type==Tversion || x->fcall.type==Tauth) + switch(x->fcall.type){ + case Tversion: + case Tauth: + case Tflush: f = nil; - else + break; + case Tattach: + f = newfid(x->fcall.fid); + break; + default: f = newfid(x->fcall.fid); + if(!f->busy){ + x->f = f; + x = respond(x, &t, "fid not in use"); + continue; + } + break; + } x->f = f; x = (*fcall[x->fcall.type])(x, f); } diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c index 13d72957..579f1944 100644 --- a/src/cmd/acme/xfid.c +++ b/src/cmd/acme/xfid.c @@ -103,8 +103,14 @@ xfidopen(Xfid *x) q = FILE(x->f->qid); switch(q){ case QWaddr: + if(w->nopen[q]++ == 0){ + w->addr = range(0, 0); + w->limit = range(-1,-1); + } + break; + case QWdata: + case QWxdata: w->nopen[q]++; - w->limit = range(-1,-1); break; case QWevent: if(w->nopen[q]++ == 0){ |