Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/Foundation/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,12 @@ open class Process: NSObject, @unchecked Sendable {
var spawnAttrs: posix_spawnattr_t = posix_spawnattr_t()
#endif
try _throwIfPosixError(posix_spawnattr_init(&spawnAttrs))
#if os(Android)
guard var spawnAttrs else {
throw NSError(domain: NSPOSIXErrorDomain, code: Int(errno),
userInfo: [NSURLErrorKey:self.executableURL!])
}
#endif
try _throwIfPosixError(posix_spawnattr_setflags(&spawnAttrs, .init(POSIX_SPAWN_SETPGROUP)))
#if canImport(Darwin)
try _throwIfPosixError(posix_spawnattr_setflags(&spawnAttrs, .init(POSIX_SPAWN_CLOEXEC_DEFAULT)))
Expand Down