about summary refs log tree commit diff
path: root/src/libstd/io/native
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-12-04 22:11:22 -0800
committerbors <bors@rust-lang.org>2013-12-04 22:11:22 -0800
commit10c8409c786b8ee43c00fadfa1be6ebbfc846a91 (patch)
tree29fad02ddee44978a53bf7d2b31f1e9af53e16bd /src/libstd/io/native
parentbd5305fbc818d0f59eaabcfd08f19e8c23ea931f (diff)
parente0264ff192a6dcca1a9fa15a740f7ddb9890d74c (diff)
downloadrust-10c8409c786b8ee43c00fadfa1be6ebbfc846a91.tar.gz
rust-10c8409c786b8ee43c00fadfa1be6ebbfc846a91.zip
auto merge of #10804 : alexcrichton/rust/less-dup, r=pcwalton
This is just an implementation detail of using libuv, so move the libuv-specific
logic into librustuv.
Diffstat (limited to 'src/libstd/io/native')
-rw-r--r--src/libstd/io/native/mod.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/io/native/mod.rs b/src/libstd/io/native/mod.rs
index cec0de00ec2..c92f480728e 100644
--- a/src/libstd/io/native/mod.rs
+++ b/src/libstd/io/native/mod.rs
@@ -206,7 +206,9 @@ impl rtio::IoFactory for IoFactory {
     }
     fn tty_open(&mut self, fd: c_int, _readable: bool) -> IoResult<~RtioTTY> {
         if unsafe { libc::isatty(fd) } != 0 {
-            Ok(~file::FileDesc::new(fd, true) as ~RtioTTY)
+            // Don't ever close the stdio file descriptors, nothing good really
+            // comes of that.
+            Ok(~file::FileDesc::new(fd, fd > libc::STDERR_FILENO) as ~RtioTTY)
         } else {
             Err(IoError {
                 kind: io::MismatchedFileTypeForOperation,