From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id EE4E72035F for ; Fri, 28 Oct 2016 17:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034379AbcJ1Rr1 (ORCPT ); Fri, 28 Oct 2016 13:47:27 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:52654 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1034374AbcJ1RrZ (ORCPT ); Fri, 28 Oct 2016 13:47:25 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id DC0864AA40; Fri, 28 Oct 2016 13:47:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=+gn9flR8cNyl5Au+nTTvGTsZvVI=; b=DbPfrA 0k1aUstX39EsQmwWlgfioDoNxiLNRIv5LniS1odziZusbMJydEE0FU7VsJUMWIy/ B4jWuQoY2G3bwPks5yi8XnvndT3Bv0Sl6GUxhjx6m+AUZL/va/622B0gjZEzJeAY RlNVGV22kPnPyEyUK9tCupCON11gdOdF/s1b4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ps+6ad7o63PWpiwxuTE+8EPVP4Z7Zo3+ ZNkZm5D73mgA5yS06flgcGZE1aFf1UcaJg5mdCsqy/ilP24K0hBZxATZQ4DAPUUp xZlgO0wBiPk2YOCC7HBOFiqJkIWDk9WPBjql36JiDn2mGPPha/dcpLA0Fzn+mcmA Wvf6PTFTlvo= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id D38104AA3F; Fri, 28 Oct 2016 13:47:23 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 5061E4AA3E; Fri, 28 Oct 2016 13:47:23 -0400 (EDT) From: Junio C Hamano To: Linus Torvalds Cc: Johannes Schindelin , Jeff King , Git Mailing List , Lars Schneider , Eric Wong Subject: Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC References: <20161025181621.4201-3-gitster@pobox.com> <20161026042555.neaxvnmggtcku5cc@sigill.intra.peff.net> <20161026164746.2fu57f4pji5qdtnh@sigill.intra.peff.net> <20161026201721.2pw4slsuyhxhcwxj@sigill.intra.peff.net> <20161027102419.dbzigj7wtr355ofh@sigill.intra.peff.net> Date: Fri, 28 Oct 2016 10:47:21 -0700 In-Reply-To: (Linus Torvalds's message of "Fri, 28 Oct 2016 10:38:03 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 94F2257E-9D36-11E6-9A06-3AB77A1B28F4-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Linus Torvalds writes: > On Fri, Oct 28, 2016 at 9:48 AM, Junio C Hamano wrote: >> >> Setting FD_CLOEXEC with fcntl(2) may be racy, but in what way >> it is broken to open(2) with O_CLOEXEC? > > Apparently windows doesn't even support it, at least not mingw. So > you'll have to have some supprt for just explicitly closing things at > execve anyway. And if you do that for windows, then what's the point > of using O_CLOEXEC on Linux, and having two totally different paths > that will just mean maintenance headache. Ah, that's where your reaction comes from. If I understood Dscho correctly, what he said was that I cannot set FD_CLOEXEC via fcntl() emulation they have. It wasn't an objection to O_CLOEXEC. In fact, since 05d1ed6148 ("mingw: ensure temporary file handles are not inherited by child processes", 2016-08-22), we have been relying on open(2) with O_CLOEXEC even on Windows (by emulating it with O_NOINHERIT, which Windows has) on some codepaths.