File tree 1 file changed +5
-5
lines changed
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 {
944
944
try _throwIfPosixError ( _CFPosixSpawnFileActionsAddClose ( fileActions, fd) )
945
945
}
946
946
947
- #if canImport(Darwin)
947
+ #if canImport(Darwin) || os(Android)
948
948
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) ) )
952
949
#else
953
950
var spawnAttrs : posix_spawnattr_t = posix_spawnattr_t ( )
951
+ #endif
954
952
try _throwIfPosixError ( posix_spawnattr_init ( & spawnAttrs) )
955
953
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
957
957
// POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple extension so emulate it.
958
958
for fd in 3 ... findMaximumOpenFD ( ) {
959
959
guard adddup2 [ fd] == nil &&
You can’t perform that action at this time.
0 commit comments