]>
git.proxmox.com Git - rustc.git/blob - tests/ui/process/process-sigpipe.rs
2 #![allow(unused_imports)]
5 // ignore-android since the dynamic linker sets a SIGPIPE handler (to do
6 // a crash report) so inheritance is moot on the entire platform
8 // libstd ignores SIGPIPE, and other libraries may set signal masks.
9 // Make sure that these behaviors don't get inherited to children
10 // spawned via std::process, since they're needed for traditional UNIX
11 // filter behavior. This test checks that `yes | head` terminates
12 // (instead of running forever), and that it does not print an error
13 // message about a broken pipe.
15 // ignore-emscripten no threads support
16 // ignore-vxworks no 'sh'
17 // ignore-fuchsia no 'sh'
24 // Just in case `yes` doesn't check for EPIPE...
26 thread
::sleep_ms(5000);
29 let output
= process
::Command
::new("sh").arg("-c").arg("yes | head").output().unwrap();
30 assert
!(output
.status
.success());
31 assert
!(output
.stderr
.len() == 0);
36 // Not worried about signal masks on other platforms