]> git.lizzy.rs Git - rust.git/commit
std: Improve pipe() functionality
authorAlex Crichton <alex@alexcrichton.com>
Mon, 9 Jun 2014 20:23:49 +0000 (13:23 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 16 Jun 2014 17:53:49 +0000 (10:53 -0700)
commit04eced750e78770e16354c07fddf7ecaaab6ef43
tree2dc3063008f8ee04805bd5e588d290afa7c02095
parent0b32d42a5da84c1f23a2b50b9a6741eea69773c4
std: Improve pipe() functionality

* os::pipe() now returns IoResult<os::Pipe>
* os::pipe() is now unsafe because it does not arrange for deallocation of file
  descriptors
* os::Pipe fields are renamed from input to reader and out to write.
* PipeStream::pair() has been added. This is a safe method to get a pair of
  pipes.
* Dealing with pipes in native process bindings have been improved to be more
  robust in the face of failure and intermittent errors. This converts a few
  fail!() situations to Err situations.

Closes #9458
cc #13538
Closes #14724
[breaking-change]
src/liblibc/lib.rs
src/libnative/io/file_unix.rs
src/libnative/io/helper_thread.rs
src/libnative/io/process.rs
src/libstd/io/pipe.rs
src/libstd/os.rs
src/test/run-pass/sigpipe-should-be-ignored.rs