[sanitizer_common] Close superfluous file descriptors in spawned process

Use attribute flag `POSIX_SPAWN_CLOEXEC_DEFAULT` in the call to
`posix_spawn`.

If this flag is set, then only file descriptors explicitly described by
the file_actions argument are available in the spawned process; all of
the other file descriptors are automatically closed in the spawned
process.

POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple-specific extension.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370121 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed