@@ -24,7 +24,8 @@ use libc::{c_int, pid_t};
24
24
use libc:: { gid_t, uid_t} ;
25
25
26
26
cfg_if:: cfg_if! {
27
- if #[ cfg( target_os = "nto" ) ] {
27
+ // This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
28
+ if #[ cfg( any( target_env = "nto70" , target_env = "nto71" ) ) ] {
28
29
use crate :: thread;
29
30
use libc:: { c_char, posix_spawn_file_actions_t, posix_spawnattr_t} ;
30
31
use crate :: time:: Duration ;
@@ -191,7 +192,7 @@ impl Command {
191
192
192
193
// Attempts to fork the process. If successful, returns Ok((0, -1))
193
194
// in the child, and Ok((child_pid, -1)) in the parent.
194
- #[ cfg( not( any( target_os = "watchos" , target_os = "tvos" , target_os = "nto " ) ) ) ]
195
+ #[ cfg( not( any( target_os = "watchos" , target_os = "tvos" , target_env = "nto70" , target_env = "nto71 ") ) ) ]
195
196
unsafe fn do_fork ( & mut self ) -> Result < pid_t , io:: Error > {
196
197
cvt ( libc:: fork ( ) )
197
198
}
@@ -200,7 +201,8 @@ impl Command {
200
201
// or closed a file descriptor while the fork() was occurring".
201
202
// Documentation says "... or try calling fork() again". This is what we do here.
202
203
// See also https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/fork.html
203
- #[ cfg( target_os = "nto" ) ]
204
+ // This workaround is only needed for QNX 7.0 and 7.1. The bug should have been fixed in 8.0
205
+ #[ cfg( any( target_env = "nto70" , target_env = "nto71" ) ) ]
204
206
unsafe fn do_fork ( & mut self ) -> Result < pid_t , io:: Error > {
205
207
use crate :: sys:: os:: errno;
206
208
0 commit comments