ignore host read eof while exiting
This commit is contained in:
parent
303cb7c6db
commit
f0264abf26
3 changed files with 9 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ uchar outdata[DATASIZE];
|
||||||
short outcount;
|
short outcount;
|
||||||
int hversion;
|
int hversion;
|
||||||
int hostfd[2];
|
int hostfd[2];
|
||||||
|
int exiting;
|
||||||
|
|
||||||
void inmesg(Hmesg, int);
|
void inmesg(Hmesg, int);
|
||||||
int inshort(int);
|
int inshort(int);
|
||||||
|
|
@ -29,6 +30,7 @@ void hplumb(int);
|
||||||
void clrlock(void);
|
void clrlock(void);
|
||||||
int snarfswap(char*, int, char**);
|
int snarfswap(char*, int, char**);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
rcv(void)
|
rcv(void)
|
||||||
{
|
{
|
||||||
|
|
@ -298,6 +300,7 @@ inmesg(Hmesg type, int count)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Hexit:
|
case Hexit:
|
||||||
|
exiting = 1;
|
||||||
outT0(Texit);
|
outT0(Texit);
|
||||||
threadexitsall(nil);
|
threadexitsall(nil);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -279,6 +279,11 @@ hostproc(void *arg)
|
||||||
n = read(hostfd[0], hostbuf[i].data, sizeof hostbuf[i].data);
|
n = read(hostfd[0], hostbuf[i].data, sizeof hostbuf[i].data);
|
||||||
if(0) fprint(2, "hostproc %d\n", n);
|
if(0) fprint(2, "hostproc %d\n", n);
|
||||||
if(n <= 0){
|
if(n <= 0){
|
||||||
|
if(n == 0){
|
||||||
|
if(exiting)
|
||||||
|
threadexits(nil);
|
||||||
|
werrstr("unexpected eof");
|
||||||
|
}
|
||||||
fprint(2, "samterm: host read error: %r\n");
|
fprint(2, "samterm: host read error: %r\n");
|
||||||
threadexitsall("host");
|
threadexitsall("host");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ extern Channel *hostc;
|
||||||
extern int hversion;
|
extern int hversion;
|
||||||
extern int plumbfd;
|
extern int plumbfd;
|
||||||
extern int hostfd[2];
|
extern int hostfd[2];
|
||||||
|
extern int exiting;
|
||||||
|
|
||||||
#define gettext sam_gettext /* stupid gcc built-in functions */
|
#define gettext sam_gettext /* stupid gcc built-in functions */
|
||||||
Rune *gettext(Flayer*, long, ulong*);
|
Rune *gettext(Flayer*, long, ulong*);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue