Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Oct 29, 2016, 17:06 UTC
- Message-ID
- <CA+55aFxsjiuR8cp9SiPS88OnzmCiNN3B-gybz1CS71avsU8OOw@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.2.20.1610291022120.3264@virtualbox>
On Sat, Oct 29, 2016 at 1:25 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> Correct. We cannot change an open file handle's state ("FD_CLOEXEC") on
> Windows, but we can ask open() to open said file handle with the correct
> flag ("O_CLOEXEC", which is mapped to O_NOINHERIT on Windows.Ok. So then I have no issues with it, and let's use O_CLOEXEC if it exists and fcntl(FD_CLOEXEC) if O_CLOEXEC doesn't exist.
Linus