@@ -7,8 +7,8 @@ use polling::{Event, PollMode, Poller};
7
7
8
8
use std:: fmt;
9
9
use std:: io:: Result ;
10
+ use std:: num:: NonZeroI32 ;
10
11
use std:: os:: unix:: io:: { AsRawFd , BorrowedFd , RawFd } ;
11
- use std:: process:: Child ;
12
12
13
13
/// The raw registration into the reactor.
14
14
///
@@ -27,8 +27,8 @@ pub enum Registration {
27
27
/// Raw signal number for signal delivery.
28
28
Signal ( Signal ) ,
29
29
30
- /// Process for process termination.
31
- Process ( Child ) ,
30
+ /// Pid for process termination.
31
+ Process ( NonZeroI32 ) ,
32
32
}
33
33
34
34
impl fmt:: Debug for Registration {
@@ -62,8 +62,8 @@ impl Registration {
62
62
Self :: Signal ( signal) => {
63
63
poller. add_filter ( PollSignal ( signal. 0 ) , token, PollMode :: Oneshot )
64
64
}
65
- Self :: Process ( process ) => poller. add_filter (
66
- unsafe { Process :: new ( process , ProcessOps :: Exit ) } ,
65
+ Self :: Process ( pid ) => poller. add_filter (
66
+ unsafe { Process :: from_pid ( * pid , ProcessOps :: Exit ) } ,
67
67
token,
68
68
PollMode :: Oneshot ,
69
69
) ,
@@ -82,8 +82,8 @@ impl Registration {
82
82
Self :: Signal ( signal) => {
83
83
poller. modify_filter ( PollSignal ( signal. 0 ) , interest. key , PollMode :: Oneshot )
84
84
}
85
- Self :: Process ( process ) => poller. modify_filter (
86
- unsafe { Process :: new ( process , ProcessOps :: Exit ) } ,
85
+ Self :: Process ( pid ) => poller. modify_filter (
86
+ unsafe { Process :: from_pid ( * pid , ProcessOps :: Exit ) } ,
87
87
interest. key ,
88
88
PollMode :: Oneshot ,
89
89
) ,
@@ -100,8 +100,8 @@ impl Registration {
100
100
poller. delete ( fd)
101
101
}
102
102
Self :: Signal ( signal) => poller. delete_filter ( PollSignal ( signal. 0 ) ) ,
103
- Self :: Process ( process ) => {
104
- poller. delete_filter ( unsafe { Process :: new ( process , ProcessOps :: Exit ) } )
103
+ Self :: Process ( pid ) => {
104
+ poller. delete_filter ( unsafe { Process :: from_pid ( * pid , ProcessOps :: Exit ) } )
105
105
}
106
106
}
107
107
}
0 commit comments