3 #![allow(unused_must_use)]
4 // Be sure that when a SIGPIPE would have been received that the entire process
5 // doesn't die in a ball of fire, but rather it's gracefully handled.
7 // ignore-emscripten no processes
8 // ignore-sgx no processes
11 use std::io::prelude::*;
13 use std::process::{Command, Stdio};
16 let _ = io::stdin().read_line(&mut String::new());
17 io::stdout().write(&[1]);
18 assert!(io::stdout().flush().is_err());
22 let args: Vec<String> = env::args().collect();
23 if args.len() > 1 && args[1] == "test" {
27 let mut p = Command::new(&args[0])
28 .stdout(Stdio::piped())
29 .stdin(Stdio::piped())
30 .arg("test").spawn().unwrap();
31 drop(p.stdout.take());
32 assert!(p.wait().unwrap().success());