rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: culliton@srg.af.mil (Tom Culliton x2278)
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	[thread overview]
Message-ID: <9405101358.aa24953@ceres.srg.af.mil> (raw)

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')



             reply	other threads:[~1994-05-10 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-05-10 17:58 Tom Culliton x2278 [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-05-10 19:53 Tom Culliton x2278
1994-05-06 22:09 Scott Schwartz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9405101358.aa24953@ceres.srg.af.mil \
    --to=culliton@srg.af.mil \
    --cc=rc@hawkwind.utcs.toronto.edu \
    --cc=schwartz@groucho.cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).