File tree 2 files changed +3
-1
lines changed
2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 10
10
extern crate libc;
11
11
12
12
use std:: env;
13
- use std:: io:: Error ;
13
+ use std:: io:: { self , Error , Write } ;
14
14
use std:: os:: unix:: process:: CommandExt ;
15
15
use std:: process:: Command ;
16
16
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -35,6 +35,7 @@ fn main() {
35
35
. arg ( "test1" )
36
36
. pre_exec ( || {
37
37
println ! ( "hello" ) ;
38
+ io:: stdout ( ) . flush ( ) . unwrap ( ) ;
38
39
Ok ( ( ) )
39
40
} )
40
41
. output ( )
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ fn main() {
57
57
58
58
stdout ( ) . write_all ( "parent stdout\n " . as_bytes ( ) ) . expect ( "failed to write to stdout" ) ;
59
59
stderr ( ) . write_all ( "parent stderr\n " . as_bytes ( ) ) . expect ( "failed to write to stderr" ) ;
60
+ stdout ( ) . flush ( ) . expect ( "failed to flush stdout" ) ;
60
61
61
62
let child = {
62
63
Command :: new ( name)
You can’t perform that action at this time.
0 commit comments