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-cloudabi no processes
8 // ignore-emscripten no processes
9 // ignore-sgx no processes
12 use std::io::prelude::*;
14 use std::process::{Command, Stdio};
17 let _ = io::stdin().read_line(&mut String::new());
18 io::stdout().write(&[1]);
19 assert!(io::stdout().flush().is_err());
23 let args: Vec<String> = env::args().collect();
24 if args.len() > 1 && args[1] == "test" {
28 let mut p = Command::new(&args[0])
29 .stdout(Stdio::piped())
30 .stdin(Stdio::piped())
31 .arg("test").spawn().unwrap();
32 drop(p.stdout.take());
33 assert!(p.wait().unwrap().success());