File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -944,16 +944,16 @@ open class Process: NSObject {
944944 try _throwIfPosixError ( _CFPosixSpawnFileActionsAddClose ( fileActions, fd) )
945945 }
946946
947- #if canImport(Darwin)
947+ #if canImport(Darwin) || os(Android)
948948 var spawnAttrs : posix_spawnattr_t ? = nil
949- try _throwIfPosixError ( posix_spawnattr_init ( & spawnAttrs) )
950- try _throwIfPosixError ( posix_spawnattr_setflags ( & spawnAttrs, . init( POSIX_SPAWN_SETPGROUP) ) )
951- try _throwIfPosixError ( posix_spawnattr_setflags ( & spawnAttrs, . init( POSIX_SPAWN_CLOEXEC_DEFAULT) ) )
952949#else
953950 var spawnAttrs : posix_spawnattr_t = posix_spawnattr_t ( )
951+ #endif
954952 try _throwIfPosixError ( posix_spawnattr_init ( & spawnAttrs) )
955953 try _throwIfPosixError ( posix_spawnattr_setflags ( & spawnAttrs, . init( POSIX_SPAWN_SETPGROUP) ) )
956-
954+ #if canImport(Darwin)
955+ try _throwIfPosixError ( posix_spawnattr_setflags ( & spawnAttrs, . init( POSIX_SPAWN_CLOEXEC_DEFAULT) ) )
956+ #else
957957 // POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple extension so emulate it.
958958 for fd in 3 ... findMaximumOpenFD ( ) {
959959 guard adddup2 [ fd] == nil &&
You can’t perform that action at this time.
0 commit comments