         CFRunLoopAddSource(managerThreadRunLoop?._cfRunLoop, source, kCFRunLoopDefaultMode)
 
         let fileActions = _CFPosixSpawnFileActionsAlloc()
-        posix(_CFPosixSpawnFileActionsInit(fileActions))
         defer {
             _CFPosixSpawnFileActionsDestroy(fileActions)
             _CFPosixSpawnFileActionsDealloc(fileActions)
         }
+        try _throwIfPosixError(_CFPosixSpawnFileActionsInit(fileActions))
 
         // File descriptors to duplicate in the child process. This allows
         // output redirection to NSPipe or NSFileHandle.

    #endif

    open func run() throws {
        self.processLaunchedCondition.lock()
        defer {
            self.processLaunchedCondition.broadcast()

    
    public static let didTerminateNotification = NSNotification.Name(rawValue: "NSTaskDidTerminateNotification")
}
