set FD_CLOEXEC properly when O_CLOEXEC is not supported
authorEric Wong <e@80x24.org>
Sat, 15 Jul 2017 18:55:40 +0000 (18:55 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jul 2017 21:52:16 +0000 (14:52 -0700)
commit9fb9495dae744098a6eb16f62b4876c87b2c773f
treebd4652321688c09f0c09aa442d88d43632c7e9fd
parent1e3001a8e2386a1433d1769a5a78007596bbc04d
set FD_CLOEXEC properly when O_CLOEXEC is not supported

FD_CLOEXEC only applies to the file descriptor, so it needs to be
manipuluated via F_GETFD/F_SETFD.  F_GETFL/F_SETFL are for file
description flags.

Verified via strace with o_cloexec set to zero.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c