@@ -3,11 +3,9 @@ use crate::fmt;
33use crate :: io:: { self , Error , ErrorKind } ;
44use crate :: mem;
55use crate :: ptr;
6- use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
76use crate :: sys;
87use crate :: sys:: cvt;
98use crate :: sys:: process:: process_common:: * ;
10- use crate :: sys_common:: FromInner ;
119
1210#[ cfg( target_os = "linux" ) ]
1311use crate :: os:: linux:: process:: PidFd ;
@@ -16,7 +14,7 @@ use crate::os::linux::process::PidFd;
1614use libc:: RTP_ID as pid_t;
1715
1816#[ cfg( not( target_os = "vxworks" ) ) ]
19- use libc:: { c_int, c_long , gid_t, pid_t, uid_t} ;
17+ use libc:: { c_int, gid_t, pid_t, uid_t} ;
2018
2119////////////////////////////////////////////////////////////////////////////////
2220// Command
@@ -132,6 +130,7 @@ impl Command {
132130 // If this fails, we will fall through this block to a call to `fork()`
133131 #[ cfg( target_os = "linux" ) ]
134132 {
133+ use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
135134 static HAS_CLONE3 : AtomicBool = AtomicBool :: new ( true ) ;
136135
137136 const CLONE_PIDFD : u64 = 0x00001000 ;
@@ -152,7 +151,7 @@ impl Command {
152151 }
153152
154153 syscall ! {
155- fn clone3( cl_args: * mut clone_args, len: libc:: size_t) -> c_long
154+ fn clone3( cl_args: * mut clone_args, len: libc:: size_t) -> libc :: c_long
156155 }
157156
158157 if HAS_CLONE3 . load ( Ordering :: Relaxed ) {
@@ -529,6 +528,7 @@ pub struct Process {
529528impl Process {
530529 #[ cfg( target_os = "linux" ) ]
531530 fn new ( pid : pid_t , pidfd : pid_t ) -> Self {
531+ use crate :: sys_common:: FromInner ;
532532 let pidfd = ( pidfd >= 0 ) . then ( || PidFd :: from_inner ( sys:: fd:: FileDesc :: new ( pidfd) ) ) ;
533533 Process { pid, status : None , pidfd }
534534 }
0 commit comments