Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 76561 invoked from network); 18 Jan 2006 14:11:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Jan 2006 14:11:39 -0000 Received: (qmail 35653 invoked by uid 500); 18 Jan 2006 14:11:28 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 35494 invoked by uid 500); 18 Jan 2006 14:11:26 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 35481 invoked by uid 99); 18 Jan 2006 14:11:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2006 06:11:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [213.115.211.24] (HELO herkules.oderland.com) (213.115.211.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2006 06:11:24 -0800 Received: from h64n5c1o1032.bredband.skanova.com ([81.225.92.64] helo=localhost.localdomain) by herkules.oderland.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.52) id 1EzE1Y-0007PS-2q; Wed, 18 Jan 2006 15:10:58 +0100 Received: from pl (helo=localhost) by localhost.localdomain with local-esmtp (Exim 4.60) (envelope-from ) id 1EzE1b-0002ny-Qi; Wed, 18 Jan 2006 15:10:59 +0100 Date: Wed, 18 Jan 2006 15:10:59 +0100 (CET) From: "Peter N. Lundblad" X-X-Sender: pl@localhost.localdomain To: Joe Orton cc: "Peter N. Lundblad" , dev@apr.apache.org Subject: Re: Pipe inheritance In-Reply-To: <20060117234200.GA8479@redhat.com> Message-ID: References: <20060117234200.GA8479@redhat.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-5832937-1137593459=:6422" X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - herkules.oderland.com X-AntiAbuse: Original Domain - apr.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - famlundblad.se X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --8323328-5832937-1137593459=:6422 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 17 Jan 2006, Joe Orton wrote: > On Tue, Jan 17, 2006 at 03:01:35PM +0100, Peter N. Lundblad wrote: > > While debugging a Subversion problem, I noted that when > > apr_file_pipe_create is called on Linux, the created file descriptors are > > inherited to child processes by default (luckily, one can reset this). > > This is inconsistent with the default for apr_file_open. If I understand > > it correctly, the Windows code also does *not* make the pipe ends > > inherited by default (it zero-inits the apr_file_t struct and doesn't seem > > to touch the flags, leaving INHERIT unset. > > Nothing of this is documented in apr_file_io.h. > > > > While I can see the reason for pipes to be inherited by default, it seems > > inconsistent to do so, and you normally only want one end to be inherited, > > so you don't save any code by having that default. > > > > I could easily provide a patch for this if you want to. Any thoughts? > > Having *both* ends not inherited doesn't seem like a good default since > the pipe is not very useful for IPC in that case, unless you've dup'ed > the fds? It wouldn't be reasonable to change that behaviour in APR 1.x > either, I'd say. > There is no default that is good in all cases here, but, at a closer look I discovered that Windows is consistent, and I agree about the problem of an API change. Please find attached a docstring patch that states the defaults in both apr_file_open and apr_file_pipe_create. Thanks, //Peter --8323328-5832937-1137593459=:6422 Content-Type: TEXT/plain; name="d.txt" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="d.txt" RG9jc3RyaW5nIGZpeC4NCg0KKiBpb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mlwdG9yIHRvIHVzZSBhcyBp bnB1dCB0byB0aGUgcGlwZS4NCiAgKiBAcGFyYW0gb3V0IFRoZSBmaWxlIGRl c2NyaXB0b3IgdG8gdXNlIGFzIG91dHB1dCBmcm9tIHRoZSBwaXBlLg0KICAq IEBwYXJhbSBwb29sIFRoZSBwb29sIHRvIG9wZXJhdGUgb24uDQorICogQHJl bWFyayBUaGUgcmV0dXJuZWQgZmlsZSBkZXNjcmlwdG9ycyB3aWxsIGJlIGlu aGVyaXRlZCBieSBjaGlsZCBwcm9jZXNzZXMuDQorICogVGhpcyBjYW4gYmUg Y2hhbmdlZCB1c2luZyBhcHJfZmlsZV9pbmhlcml0X3Vuc2V0KCkuDQogICov DQogQVBSX0RFQ0xBUkUoYXByX3N0YXR1c190KSBhcHJfZmlsZV9waXBlX2Ny ZWF0ZShhcHJfZmlsZV90ICoqaW4sIA0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYXByX2ZpbGVfdCAqKm91dCwN Cg== --8323328-5832937-1137593459=:6422--