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