@@ -57,13 +57,13 @@ private let _posix_spawn_file_actions_addclosefrom_np = symbol(named: "posix_spa
57
57
/// consistently available across all platforms that implement the
58
58
/// `posix_spawn()` API.
59
59
private let _posix_spawn_file_actions_addchdir = symbol ( named: " posix_spawn_file_actions_addchdir " ) . map {
60
- print ( " !!FOUND posix_spawn_file_actions_addchdir " )
60
+ try ! FileHandle . stderr . write ( " !!FOUND posix_spawn_file_actions_addchdir \n " )
61
61
return castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
62
62
} ?? symbol ( named: " posix_spawn_file_actions_addchdir_np " ) . map {
63
- print ( " !!FOUND posix_spawn_file_actions_addchdir_np " )
63
+ try ! FileHandle . stderr . write ( " !!FOUND posix_spawn_file_actions_addchdir_np \n " )
64
64
return castCFunction ( at: $0, to: ( @convention( c) ( UnsafeMutablePointer < P < posix_spawn_file_actions_t > > , UnsafePointer < CChar > ) - > CInt) . self)
65
65
} ?? {
66
- print ( " !!DID NOT FIND posix_spawn_file_actions_addchdir[_np] " )
66
+ try ! FileHandle . stderr . write ( " !!DID NOT FIND posix_spawn_file_actions_addchdir[_np] \n " )
67
67
return nil
68
68
} ( )
69
69
#endif
@@ -163,11 +163,13 @@ func spawnExecutable(
163
163
// posix_spawn(), so set it here in the parent process and hope
164
164
// another thread does not stomp on the change (as Foundation does.)
165
165
// Platforms known to take this path: Amazon Linux 2, OpenBSD, QNX
166
- print ( " !!CALLING chdir " )
166
+ try ! FileHandle . stderr . write ( " !!CALLING chdir \n " )
167
167
guard 0 == chdir ( currentDirectoryPath) else {
168
168
throw CError ( rawValue: swt_errno ( ) )
169
169
}
170
170
}
171
+
172
+ throw SystemError ( description: " Early exiting to report on chdir. " )
171
173
}
172
174
173
175
// Forward standard I/O streams and any explicitly added file handles.
0 commit comments