Re: [PATCH v3 2/3] sha1_file: open window into packfiles with O_CLOEXEC
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 29, 2016, 08:25 UTC
- Message-ID
- <alpine.DEB.2.20.1610291022120.3264@virtualbox>
- In-Reply-To
- <xmqqr370vtba.fsf@gitster.mtv.corp.google.com>
Hi,
On Fri, 28 Oct 2016, Junio C Hamano wrote:
Show 7 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes: > > > Apparently windows doesn't even support it, at least not mingw.... > > Assuming that the above was a misunderstanding, assuming that we can > do O_CLOEXEC (but not FD_CLOEXEC) on Windows just fine, where stray > file descriptors held open in the children matter more, and ...
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.
And for the record: I agree with Junio that we cannot simply drop this O_CLOEXEC business.
Because it was introduced to fix bugs.
Thank you for your time, Johannes