Tweaks to make it work on Unix.

This commit is contained in:
rsc 2003-10-11 02:45:02 +00:00
parent 079d45c20e
commit 941c9f36a9
6 changed files with 86 additions and 66 deletions

View file

@ -16,6 +16,7 @@ uchar indata[DATASIZE+1]; /* room for NUL */
uchar outdata[DATASIZE];
short outcount;
int hversion;
int hostfd[2];
void inmesg(Hmesg, int);
int inshort(int);
@ -510,7 +511,7 @@ outsend(void)
panic("outcount>sizeof outdata");
outdata[1]=outcount;
outdata[2]=outcount>>8;
if(write(1, (char *)outdata, outcount+HSIZE)!=outcount+HSIZE)
if(write(hostfd[1], (char *)outdata, outcount+HSIZE)!=outcount+HSIZE)
panic("write error");
}
@ -651,7 +652,7 @@ hsetsnarf(int nc)
s1[n] = 0;
snarflen = n;
outTs(Tsetsnarf, n);
if(n>0 && write(1, s1, n)!=n)
if(n>0 && write(hostfd[1], s1, n)!=n)
panic("snarf write error");
free(s1);
}else