Xref: utzoo news.software.b:6126 news.software.nntp:897 Path: utzoo!utstat!news-server.csri.toronto.edu!utgpu!watserv1!ria!ria.ccs.uwo.ca!reggers From: reggers@ria.ccs.uwo.ca (Reg Quinton) Newsgroups: news.software.b,news.software.nntp Subject: Re: Rn and ^Z on IRIX Message-ID: <1990Nov6.082615@ria.ccs.uwo.ca> Date: 6 Nov 90 08:26:15 GMT References: <1990Nov5.121957@ria.ccs.uwo.ca> Sender: news@ria.ccs.uwo.ca Reply-To: reggers@ria.ccs.uwo.ca (Reg Quinton) Followup-To: news.software.b Organization: Univ. Western Ontario, London Ont. CA Lines: 42 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); } Brought to you by Super Global Mega Corp .com