From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8837 invoked by alias); 27 Apr 2009 20:56:16 -0000 Received: (qmail 8753 invoked by uid 22791); 27 Apr 2009 20:56:15 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Apr 2009 20:56:12 +0000 Received: from zps75.corp.google.com (zps75.corp.google.com [172.25.146.75]) by smtp-out.google.com with ESMTP id n3RKtqmk032375; Mon, 27 Apr 2009 21:55:52 +0100 Received: from smtp.corp.google.com (spacemonkey1.corp.google.com [192.168.120.115]) by zps75.corp.google.com with ESMTP id n3RKtnZA013959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 27 Apr 2009 13:55:50 -0700 Received: from localhost.localdomain.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) (authenticated bits=0) by smtp.corp.google.com (8.13.8/8.13.8) with ESMTP id n3RKtmvx025362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 27 Apr 2009 13:55:49 -0700 To: Julian Brown Cc: gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org, binutils@sourceware.org Subject: Re: [PATCH, libiberty] Pex pipes block under win32 when parent process dies References: <20090427153649.53adf4f0@rex.config> From: Ian Lance Taylor Date: Mon, 27 Apr 2009 20:56:00 -0000 In-Reply-To: <20090427153649.53adf4f0@rex.config> (Julian Brown's message of "Mon\, 27 Apr 2009 15\:36\:49 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00741.txt.bz2 Julian Brown writes: > libiberty/ > * pex-win32.c (pex_win32_pipe): Add _O_NOINHERIT. > (pex_win32_exec_child): Ensure each process has only one handle > open on pipe endpoints. Close standard input after creating child > for symmetry with standard output/standard error. > + /* Ensure we have inheritable descriptors to pass to the child, and close the > + original descriptors. */ > + orig_in = in; > + in = _dup (orig_in); > + obj->funcs->close (obj, orig_in); You can just call _close, here and below (i.e., change the existing code). obj->funcs->close is always going to be pex_win32_close. I don't see any need to do the indirection. That would mean not removing the ATTRIBUTE_UNUSED on obj. OK with that change. Thanks. Ian