From 70daae2bd75a5da65cdc51f7a1ff2c67679a02a2 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 5 Sep 1999 19:16:53 +0000 Subject: [PATCH] (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 --- appl/telnet/telnetd/utility.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/appl/telnet/telnetd/utility.c b/appl/telnet/telnetd/utility.c index 4bae20554..3e74129fd 100644 --- a/appl/telnet/telnetd/utility.c +++ b/appl/telnet/telnetd/utility.c @@ -47,9 +47,11 @@ RCSID("$Id$"); * data from the network, and pass it through the telnet state * machine. We also flush the pty input buffer (by dropping its data) * if it becomes too full. + * + * return 0 if OK or 1 if interrupted by a signal. */ -void +int ttloop(void) { void netflush(void); @@ -61,6 +63,8 @@ ttloop(void) netflush(); ncc = read(net, netibuf, sizeof netibuf); if (ncc < 0) { + if (errno == EINTR) + return 1; syslog(LOG_INFO, "ttloop: read: %m\n"); exit(1); } else if (ncc == 0) { @@ -76,6 +80,7 @@ ttloop(void) pfrontp = pbackp = ptyobuf; telrcv(); } + return 0; } /* end of ttloop */ /*