@@ -3,11 +3,9 @@ use crate::fmt;
3
3
use crate :: io:: { self , Error , ErrorKind } ;
4
4
use crate :: mem;
5
5
use crate :: ptr;
6
- use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
7
6
use crate :: sys;
8
7
use crate :: sys:: cvt;
9
8
use crate :: sys:: process:: process_common:: * ;
10
- use crate :: sys_common:: FromInner ;
11
9
12
10
#[ cfg( target_os = "linux" ) ]
13
11
use crate :: os:: linux:: process:: PidFd ;
@@ -16,7 +14,7 @@ use crate::os::linux::process::PidFd;
16
14
use libc:: RTP_ID as pid_t;
17
15
18
16
#[ 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} ;
20
18
21
19
////////////////////////////////////////////////////////////////////////////////
22
20
// Command
@@ -132,6 +130,7 @@ impl Command {
132
130
// If this fails, we will fall through this block to a call to `fork()`
133
131
#[ cfg( target_os = "linux" ) ]
134
132
{
133
+ use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
135
134
static HAS_CLONE3 : AtomicBool = AtomicBool :: new ( true ) ;
136
135
137
136
const CLONE_PIDFD : u64 = 0x00001000 ;
@@ -152,7 +151,7 @@ impl Command {
152
151
}
153
152
154
153
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
156
155
}
157
156
158
157
if HAS_CLONE3 . load ( Ordering :: Relaxed ) {
@@ -529,6 +528,7 @@ pub struct Process {
529
528
impl Process {
530
529
#[ cfg( target_os = "linux" ) ]
531
530
fn new ( pid : pid_t , pidfd : pid_t ) -> Self {
531
+ use crate :: sys_common:: FromInner ;
532
532
let pidfd = ( pidfd >= 0 ) . then ( || PidFd :: from_inner ( sys:: fd:: FileDesc :: new ( pidfd) ) ) ;
533
533
Process { pid, status : None , pidfd }
534
534
}
0 commit comments