From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11227 invoked from network); 22 Mar 2005 14:04:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Mar 2005 14:04:22 -0000 Received: (qmail 98567 invoked from network); 22 Mar 2005 14:04:16 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Mar 2005 14:04:16 -0000 Received: (qmail 17784 invoked by alias); 22 Mar 2005 14:04:12 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21047 Received: (qmail 17751 invoked from network); 22 Mar 2005 14:04:11 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 22 Mar 2005 14:04:11 -0000 Received: (qmail 98273 invoked from network); 22 Mar 2005 14:04:11 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 22 Mar 2005 14:04:04 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Tue, 22 Mar 2005 14:02:28 +0000 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 22 Mar 2005 14:06:06 +0000 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j2ME41PU009575 for ; Tue, 22 Mar 2005 14:04:01 GMT Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j2ME41EL009572 for ; Tue, 22 Mar 2005 14:04:01 GMT Message-Id: <200503221404.j2ME41EL009572@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk Subject: Re: Any comment on file descriptor behavior in functions? In-reply-to: <1050321002236.ZM10916@candle.brasslantern.com> References: <1050321002236.ZM10916@candle.brasslantern.com> Date: Tue, 22 Mar 2005 14:04:00 +0000 From: Peter Stephenson X-OriginalArrivalTime: 22 Mar 2005 14:06:06.0782 (UTC) FILETIME=[4A8AADE0:01C52EE8] X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Bart Schaefer wrote: > Specifically zsh-workers/20991: > > > It could be argued that descriptors opened by process substitution > > should remain open across external command execution within functions; > > they do, in e.g. bash. > > (But don't in zsh, in case that isn't clear.) Is this it? Does it have other effects? Index: Src/exec.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/exec.c,v retrieving revision 1.84 diff -u -r1.84 exec.c --- Src/exec.c 6 Feb 2005 20:36:42 -0000 1.84 +++ Src/exec.c 22 Mar 2005 13:55:17 -0000 @@ -496,7 +496,13 @@ } argv = makecline(args); - closem(3); + /* + * At this point we used to: + * closem(3); + * which had the effect of closing file descriptors opened + * for process substitution. However, experience suggests + * it's better to leave these open for other processes to use. + */ child_unblock(); if ((int) strlen(arg0) >= PATH_MAX) { zerr("command too long: %s", arg0, 0); -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************