Enable POSIX_SPAWN_CLOEXEC_DEFAULT (a darwin specific flag) when available when using posix_spawn to spawn processes to close all file handles.

llvm-svn: 196404
This commit is contained in:
Greg Clayton 2013-12-04 19:38:57 +00:00
parent 7749514293
commit c8b38d3389
1 changed files with 4 additions and 4 deletions

View File

@ -1329,10 +1329,10 @@ GetPosixspawnFlags (ProcessLaunchInfo &launch_info)
if (launch_info.GetLaunchInSeparateProcessGroup())
flags |= POSIX_SPAWN_SETPGROUP;
//#ifdef POSIX_SPAWN_CLOEXEC_DEFAULT
// // Close all files exception those with file actions if this is supported.
// flags |= POSIX_SPAWN_CLOEXEC_DEFAULT;
//#endif
#ifdef POSIX_SPAWN_CLOEXEC_DEFAULT
// Close all files exception those with file actions if this is supported.
flags |= POSIX_SPAWN_CLOEXEC_DEFAULT;
#endif
return flags;
}