@@ -527,25 +527,10 @@ impl Stdio {
527
527
} ,
528
528
529
529
Stdio :: MakePipe => {
530
- // Handles that are passed to a child process must be synchronous
531
- // because they will be read synchronously (see #95759).
532
- // Therefore we prefer to make both ends of a pipe synchronous
533
- // just in case our end of the pipe is passed to another process.
534
- //
535
- // However, we may need to read from both the child's stdout and
536
- // stderr simultaneously when waiting for output. This requires
537
- // async reads so as to avoid blocking either pipe.
538
- //
539
- // The solution used here is to make handles synchronous
540
- // except for our side of the stdout and sterr pipes.
541
- // If our side of those pipes do end up being given to another
542
- // process then we use a "pipe relay" to synchronize access
543
- // (see `Stdio::AsyncPipe` below).
530
+ // If stdin then make synchronous
544
531
let pipes = if stdio_id == c:: STD_INPUT_HANDLE {
545
- // For stdin both sides of the pipe are synchronous.
546
532
Pipes :: new_synchronous ( false , true ) ?
547
533
} else {
548
- // For stdout/stderr our side of the pipe is async and their side is synchronous.
549
534
pipe:: anon_pipe ( true , true ) ?
550
535
} ;
551
536
* pipe = Some ( pipes. ours ) ;
@@ -582,9 +567,6 @@ impl Stdio {
582
567
583
568
impl From < AnonPipe > for Stdio {
584
569
fn from ( pipe : AnonPipe ) -> Stdio {
585
- // Note that it's very important we don't give async handles to child processes.
586
- // Therefore if the pipe is asynchronous we must have a way to turn it synchronous.
587
- // See #95759.
588
570
match pipe {
589
571
AnonPipe :: Sync ( handle) => Stdio :: Handle ( handle) ,
590
572
AnonPipe :: Async ( handle) => Stdio :: AsyncPipe ( handle) ,
0 commit comments