(ttloop): make it return 1 if interrupted by a signal, which must have
been what was meant from the beginning git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6900 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -47,9 +47,11 @@ RCSID("$Id$");
|
|||||||
* data from the network, and pass it through the telnet state
|
* data from the network, and pass it through the telnet state
|
||||||
* machine. We also flush the pty input buffer (by dropping its data)
|
* machine. We also flush the pty input buffer (by dropping its data)
|
||||||
* if it becomes too full.
|
* if it becomes too full.
|
||||||
|
*
|
||||||
|
* return 0 if OK or 1 if interrupted by a signal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
int
|
||||||
ttloop(void)
|
ttloop(void)
|
||||||
{
|
{
|
||||||
void netflush(void);
|
void netflush(void);
|
||||||
@@ -61,6 +63,8 @@ ttloop(void)
|
|||||||
netflush();
|
netflush();
|
||||||
ncc = read(net, netibuf, sizeof netibuf);
|
ncc = read(net, netibuf, sizeof netibuf);
|
||||||
if (ncc < 0) {
|
if (ncc < 0) {
|
||||||
|
if (errno == EINTR)
|
||||||
|
return 1;
|
||||||
syslog(LOG_INFO, "ttloop: read: %m\n");
|
syslog(LOG_INFO, "ttloop: read: %m\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
} else if (ncc == 0) {
|
} else if (ncc == 0) {
|
||||||
@@ -76,6 +80,7 @@ ttloop(void)
|
|||||||
pfrontp = pbackp = ptyobuf;
|
pfrontp = pbackp = ptyobuf;
|
||||||
telrcv();
|
telrcv();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
} /* end of ttloop */
|
} /* end of ttloop */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user