File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -19,16 +19,19 @@ use std::{
19
19
fmt:: Debug ,
20
20
fs:: { File , OpenOptions } ,
21
21
io:: Result ,
22
- os:: unix:: { fs:: OpenOptionsExt , io:: AsRawFd } ,
22
+ os:: unix:: {
23
+ fs:: OpenOptionsExt ,
24
+ io:: { AsRawFd , OwnedFd } ,
25
+ } ,
23
26
process:: Stdio ,
24
27
sync:: Mutex ,
25
28
} ;
26
29
27
30
use log:: debug;
28
31
use nix:: unistd:: { Gid , Uid } ;
29
- use os_pipe:: { PipeReader , PipeWriter } ;
30
32
#[ cfg( feature = "async" ) ]
31
33
use tokio:: io:: { AsyncRead , AsyncWrite } ;
34
+ use tokio:: net:: unix:: pipe;
32
35
33
36
use crate :: Command ;
34
37
@@ -100,8 +103,8 @@ impl Default for IOOption {
100
103
/// When one side of the pipe is closed, the state will be represented with [`None`].
101
104
#[ derive( Debug ) ]
102
105
pub struct Pipe {
103
- rd : PipeReader ,
104
- wr : PipeWriter ,
106
+ rd : OwnedFd ,
107
+ wr : OwnedFd ,
105
108
}
106
109
107
110
#[ derive( Debug ) ]
@@ -113,7 +116,9 @@ pub struct PipedIo {
113
116
114
117
impl Pipe {
115
118
fn new ( ) -> std:: io:: Result < Self > {
116
- let ( rd, wr) = os_pipe:: pipe ( ) ?;
119
+ let ( tx, rx) = pipe:: pipe ( ) ?;
120
+ let rd = tx. into_blocking_fd ( ) ?;
121
+ let wr = rx. into_blocking_fd ( ) ?;
117
122
Ok ( Self { rd, wr } )
118
123
}
119
124
}
You can’t perform that action at this time.
0 commit comments