aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-01-06 18:03:09 +0000
committerrsc <devnull@localhost>2006-01-06 18:03:09 +0000
commited0601ee18c398553b2f67ea5c2618ae306a6ad5 (patch)
tree926a8b25e893e32bd4eeae1b9b1d0c3837424567 /src/cmd/9p.c
parente29d0c84fea05f317385ab1a8f3abceb7726b1bb (diff)
downloadplan9port-ed0601ee18c398553b2f67ea5c2618ae306a6ad5.tar.gz
plan9port-ed0601ee18c398553b2f67ea5c2618ae306a6ad5.tar.bz2
plan9port-ed0601ee18c398553b2f67ea5c2618ae306a6ad5.zip
fix
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 7d218e67..1fa040c4 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -323,6 +323,7 @@ xrdwr(int argc, char **argv)
void
rdcon(void *v)
{
+ int n;
char buf[4096];
CFid *fid;
@@ -331,6 +332,8 @@ rdcon(void *v)
n = read(0, buf, sizeof buf);
if(n <= 0)
threadexitsall(0);
+ if(buf[0] == 'R'-'A'+1)
+ threadexitsall(0);
if(fswrite(fid, buf, n) != n)
fprint(2, "write: %r\n");
}
@@ -357,9 +360,9 @@ xcon(int argc, char **argv)
usage();
fid = xopen(argv[0], ORDWR);
- proccreate(rdcon, fid, STACK);
+ proccreate(rdcon, fid, 32768);
for(;;){
- n = fsread(fid, buf, n);
+ n = fsread(fid, buf, sizeof buf);
if(n <= 0)
threadexitsall(0);
if(nocr){