File tree 4 files changed +25
-9
lines changed
4 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -81,16 +81,10 @@ impl Read for StdinRaw {
81
81
}
82
82
impl Write for StdoutRaw {
83
83
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > { self . 0 . write ( buf) }
84
- #[ cfg( not( target_os = "redox" ) ) ]
85
- fn flush ( & mut self ) -> io:: Result < ( ) > { Ok ( ( ) ) }
86
- #[ cfg( target_os = "redox" ) ]
87
84
fn flush ( & mut self ) -> io:: Result < ( ) > { self . 0 . flush ( ) }
88
85
}
89
86
impl Write for StderrRaw {
90
87
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > { self . 0 . write ( buf) }
91
- #[ cfg( not( target_os = "redox" ) ) ]
92
- fn flush ( & mut self ) -> io:: Result < ( ) > { Ok ( ( ) ) }
93
- #[ cfg( target_os = "redox" ) ]
94
88
fn flush ( & mut self ) -> io:: Result < ( ) > { self . 0 . flush ( ) }
95
89
}
96
90
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ impl io::Write for Stderr {
73
73
}
74
74
75
75
fn flush ( & mut self ) -> io:: Result < ( ) > {
76
- cvt ( syscall :: fsync ( 2 ) ) . and ( Ok ( ( ) ) )
76
+ Stderr :: flush ( self )
77
77
}
78
78
}
79
79
Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ impl Stdout {
43
43
fd. into_raw ( ) ;
44
44
ret
45
45
}
46
+
47
+ pub fn flush ( & self ) -> io:: Result < ( ) > {
48
+ Ok ( ( ) )
49
+ }
46
50
}
47
51
48
52
impl Stderr {
@@ -54,6 +58,10 @@ impl Stderr {
54
58
fd. into_raw ( ) ;
55
59
ret
56
60
}
61
+
62
+ pub fn flush ( & self ) -> io:: Result < ( ) > {
63
+ Ok ( ( ) )
64
+ }
57
65
}
58
66
59
67
// FIXME: right now this raw stderr handle is used in a few places because
@@ -63,7 +71,10 @@ impl io::Write for Stderr {
63
71
fn write ( & mut self , data : & [ u8 ] ) -> io:: Result < usize > {
64
72
Stderr :: write ( self , data)
65
73
}
66
- fn flush ( & mut self ) -> io:: Result < ( ) > { Ok ( ( ) ) }
74
+
75
+ fn flush ( & mut self ) -> io:: Result < ( ) > {
76
+ Stderr :: flush ( self )
77
+ }
67
78
}
68
79
69
80
pub const EBADF_ERR : i32 = :: libc:: EBADF as i32 ;
Original file line number Diff line number Diff line change @@ -156,6 +156,10 @@ impl Stdout {
156
156
pub fn write ( & self , data : & [ u8 ] ) -> io:: Result < usize > {
157
157
write ( & self . 0 , data)
158
158
}
159
+
160
+ pub fn flush ( & self ) -> io:: Result < ( ) > {
161
+ Ok ( ( ) )
162
+ }
159
163
}
160
164
161
165
impl Stderr {
@@ -166,6 +170,10 @@ impl Stderr {
166
170
pub fn write ( & self , data : & [ u8 ] ) -> io:: Result < usize > {
167
171
write ( & self . 0 , data)
168
172
}
173
+
174
+ pub fn flush ( & self ) -> io:: Result < ( ) > {
175
+ Ok ( ( ) )
176
+ }
169
177
}
170
178
171
179
// FIXME: right now this raw stderr handle is used in a few places because
@@ -175,7 +183,10 @@ impl io::Write for Stderr {
175
183
fn write ( & mut self , data : & [ u8 ] ) -> io:: Result < usize > {
176
184
Stderr :: write ( self , data)
177
185
}
178
- fn flush ( & mut self ) -> io:: Result < ( ) > { Ok ( ( ) ) }
186
+
187
+ fn flush ( & mut self ) -> io:: Result < ( ) > {
188
+ Stderr :: flush ( self )
189
+ }
179
190
}
180
191
181
192
impl NoClose {
You can’t perform that action at this time.
0 commit comments