From e0264ff192a6dcca1a9fa15a740f7ddb9890d74c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 4 Dec 2013 08:51:47 -0800 Subject: Don't dup the stdio file descriptors. This is just an implementation detail of using libuv, so move the libuv-specific logic into librustuv. --- src/libstd/io/native/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libstd/io/native') 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, -- cgit 1.4.1-3-g733a5