From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9868 invoked from network); 31 Mar 2005 09:52:32 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 31 Mar 2005 09:52:32 -0000 Received: (qmail 71891 invoked from network); 31 Mar 2005 09:52:24 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 31 Mar 2005 09:52:24 -0000 Received: (qmail 10952 invoked by alias); 31 Mar 2005 09:52:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21073 Received: (qmail 10938 invoked from network); 31 Mar 2005 09:52:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 31 Mar 2005 09:52:20 -0000 Received: (qmail 71629 invoked from network); 31 Mar 2005 09:52:20 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 31 Mar 2005 09:52:15 -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 ; Thu, 31 Mar 2005 10:50:38 +0100 Received: from news01.csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 31 Mar 2005 10:54:40 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.1/8.12.11) with ESMTP id j2V8qVfV005743 for ; Thu, 31 Mar 2005 09:52:31 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.1/8.13.1/Submit) with ESMTP id j2V8qUib005740 for ; Thu, 31 Mar 2005 09:52:30 +0100 Message-Id: <200503310852.j2V8qUib005740@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: <1050326170515.ZM19503@candle.brasslantern.com> References: <1050321002236.ZM10916@candle.brasslantern.com> <200503221404.j2ME41EL009572@news01.csr.com> <1050322171125.ZM13668@candle.brasslantern.com> <200503221831.j2MIVI09014962@news01.csr.com> <1050326170515.ZM19503@candle.brasslantern.com> Date: Thu, 31 Mar 2005 09:52:30 +0100 From: Peter Stephenson X-OriginalArrivalTime: 31 Mar 2005 09:54:40.0533 (UTC) FILETIME=[A8278450:01C535D7] 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: > } As far as I can see, when entering a function the values for process > } subsitutions would be incremented so that both types would be closed for > } an external program, but on a nested function they'd both be incremented > } further so they wouldn't. > > Yes, I concur. What I can't figure out is why they need to be incremented > at all? Why not just assign them the do-not-close value to begin with? > Something having to do with them persisting for only one command? I think it's to do with the way they're closed. There's no way of knowing whether they're attached to the command currently passing through execcmd() or to some shell structure that's calling a command at a lower level, so there's the risk of a file descriptor being closed too early. A more rational way to do this might be to have a list of file descriptors to close in the job structure, like the existing "filelist" of temporary files to be deleted. I'll commit my patch. -- 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. **********************************************************************