zsh-users
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Daniel Rigal <daniel.rigal@deep-thought.ericsson.se>,
	zsh-users@math.gatech.edu
Subject: PATCH: Re: Backticks In zshenv
Date: Tue, 20 Oct 1998 12:54:49 -0700	[thread overview]
Message-ID: <981020125449.ZM6543@candle.brasslantern.com> (raw)
In-Reply-To: <981020095542.ZM5494@candle.brasslantern.com>

On Oct 20,  9:55am, Bart Schaefer wrote:
} Subject: Re: Backticks In zshenv
}
} I suspect zsh is getting some kind of a signal -- perhaps SIGWINCH? --
} which is interrupting the read on the command substitution.

The /etc/zshenv on the RH5.1 machine now looks (in part) like this:

##
for i in {23..31}; do trap "echo caught signal $i" $i; done

if [ `id -u` -eq 0 ]; then
  path=(/sbin /usr/sbin)
fi

# ... some other stuff ...

trap - {23..31}
##

(BTW, DON'T try this without the "trap -", or zsh can go into an infinite
loop; I haven't tracked *that* down, but it seems to be SIGWINCH-related
as well.)

When I rlogin to that machine, I see:

caught signal 28
/etc/zshenv: parse error: condition expected: -eq [14]

I'm now 99% certain that the SIGWINCH is causing read() to fail with EINTR
during the fgetc() in readoutput() in exec.c.

I'm unable to adequately test the following patch at the moment, as it's
inconvenient to muck with the shells on the RH5.1 machine, but it doesn't
break anything obvious on my RH4.2 machine at home.  If anyone has time to
try this out, please tell the list whether it works.

Index: Src/exec.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.0/Src/exec.c,v
retrieving revision 1.4
diff -c -r1.4 exec.c
*** exec.c	1997/06/27 19:57:19	1.4
--- exec.c	1998/10/20 19:46:11
***************
*** 2104,2110 ****
      fin = fdopen(in, "r");
      ret = newlinklist();
      ptr = buf = (char *) ncalloc(bsiz = 64);
!     while ((c = fgetc(fin)) != EOF) {
  	if (imeta(c)) {
  	    *ptr++ = Meta;
  	    c ^= 32;
--- 2104,2115 ----
      fin = fdopen(in, "r");
      ret = newlinklist();
      ptr = buf = (char *) ncalloc(bsiz = 64);
!     while ((c = fgetc(fin)) != EOF || errno == EINTR) {
! 	if (c == EOF) {
! 	    errno = 0;
! 	    clearerr(fin);
! 	    continue;
! 	}
  	if (imeta(c)) {
  	    *ptr++ = Meta;
  	    c ^= 32;


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  parent reply	other threads:[~1998-10-20 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-20 14:35 Daniel Rigal
1998-10-20 16:55 ` Bart Schaefer
1998-10-20 19:30   ` Phil Pennock
1998-10-20 19:54   ` Bart Schaefer [this message]
1998-10-20 20:36   ` Sweth Chandramouli
1998-10-21  7:33   ` Goran Larsson

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=981020125449.ZM6543@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=daniel.rigal@deep-thought.ericsson.se \
    --cc=zsh-users@math.gatech.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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