git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Oct 2016 17:41:41 +0000 (10:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Nov 2016 02:34:16 +0000 (19:34 -0700)
commit1e3001a8e2386a1433d1769a5a78007596bbc04d
tree96d4e4d5211721c894221b1bb53955a8660b603a
parent1b8ac5ead520146802debd52cb38e5c27b3483a2
git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback

A platform might not support open(2) with O_CLOEXEC but may support
telling the same with fcntl(2) to flip FD_CLOEXEC bit on on an open
file descriptor.  It is a fallback that is inherently racy and this
may not be worth doing, though.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c