[news.software.nntp] Rn and ^Z on IRIX

reggers@ria.ccs.uwo.ca (Reg Quinton) (11/05/90)

I'm having problems getting rn (actually rrn) to handle ^Z properly
on an IRIX machine. If I stop rn with a ^Z, and then later bring
it up with an fg command I get:
----
[12:21pm grafxa] fg
./rn
rn read error: Interrupted system call

Caught an internal error--.newsrc restored
----
has anyone else seen this problem?

reggers@ria.ccs.uwo.ca (Reg Quinton) (11/06/90)

In article <1990Nov5.121957@ria.ccs.uwo.ca>, reggers@ria.ccs.uwo.ca (Reg
Quinton) writes:
|> I'm having problems getting rn (actually rrn) to handle ^Z properly
|> on an IRIX machine. If I stop rn with a ^Z, and then later bring
|> it up with an fg command I get:
|> ----
|> [12:21pm grafxa] fg
|> ./rn
|> rn read error: Interrupted system call
|> 
|> Caught an internal error--.newsrc restored
|> ----

I don't know if this is fixed in patch 48 (I see that's coming out as I
write). However, here's the problem and solution. On some machines the
^Z,
fg sequence can give you interrupted a read operation. This returns an
errno == EINTR. The code in term.c should be modified as follows to try
the read again if such an error occurs.

---

/* get a character into a buffer */

void
getcmd(whatbuf)
register char *whatbuf;
{
 ....
    for (;;) {
	int_count = 0;
	errno = 0;
	if (read_tty(whatbuf,1) < 0)
	    /* on return from ^Z, try again */
            if (errno == EINTR) continue;
            else
	    if (!errno)
	        errno = EINTR;
	    else {
	    perror(readerr);
	    sig_catcher(0);
	}