From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3.UU.NET ([192.48.96.8]) by hawkwind.utcs.utoronto.ca with SMTP id <23981>; Tue, 10 May 1994 14:18:24 -0400 Received: from uucp3.uu.net by relay3.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA25680; Tue, 10 May 94 14:18:19 -0400 Received: from srg.UUCP by uucp3.uu.net with UUCP/RMAIL ; Tue, 10 May 1994 14:18:19 -0400 Received: from ceres.srg.af.mil by srg.srg.af.mil id aa04209; Tue, 10 May 94 13:58:59 EDT From: culliton@srg.af.mil (Tom Culliton x2278) X-Mailer: SCO System V Mail (version 3.2) To: rc@hawkwind.utcs.toronto.edu, schwartz@groucho.cse.psu.edu Subject: Re: signals and stuff Date: Tue, 10 May 1994 13:58:36 -0400 Message-Id: <9405101358.aa24953@ceres.srg.af.mil> Well, the patch to rc-1.5beta1 in Scott's message gave me the clue I needed. It fixes the problem (for rc without readline) by ensuring that interrupted reads aren't treated as an EOF. Here is a patch to do the same thing when using readline. Both patches should be applied if you use readline. If you don't, at least apply the patch from Byron that Scott passed along so that your signal handlers work right. Tom ------------------------------------------------------------------------------ *** input.c Tue May 10 13:38:19 1994 --- input.cn Tue May 10 13:26:13 1994 *************** *** 96,108 **** slow = TRUE; if (!interrupt_happened) r = readline(prompt); ! else r = NULL; ! } else r = NULL; - slow = FALSE; - if (r == NULL) errno = EINTR; sigchk(); return r; } --- 96,110 ---- slow = TRUE; if (!interrupt_happened) r = readline(prompt); ! else { r = NULL; ! errno = EINTR; ! } ! } else { r = NULL; errno = EINTR; + } + slow = FALSE; sigchk(); return r; } *************** *** 123,128 **** --- 125,132 ---- if (interactive && istack->fd == 0) { rlinebuf = rc_readline(prompt); if (rlinebuf == NULL) { + if (errno == EINTR) /* retry interrupted read */ + continue; chars_in = 0; } else { if (*rlinebuf != '\0')