mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
fix
This commit is contained in:
parent
e29d0c84fe
commit
ed0601ee18
1 changed files with 5 additions and 2 deletions
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue