From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2870 invoked from network); 20 Oct 1998 20:43:54 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 20 Oct 1998 20:43:54 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id QAA12031; Tue, 20 Oct 1998 16:36:19 -0400 (EDT) Resent-Date: Tue, 20 Oct 1998 16:36:07 -0400 (EDT) From: "Bart Schaefer" Message-Id: <981020125449.ZM6543@candle.brasslantern.com> Date: Tue, 20 Oct 1998 12:54:49 -0700 In-Reply-To: <981020095542.ZM5494@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "Re: Backticks In zshenv" (Oct 20, 9:55am) References: <362C9FB4.B4C08045@guildford.ericsson.se> <981020095542.ZM5494@candle.brasslantern.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Daniel Rigal , zsh-users@math.gatech.edu Subject: PATCH: Re: Backticks In zshenv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"Kb--d.0.Gx2.tGFBs"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1880 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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