Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't raise EndOfFile when stdin::read reaches EOF. #11126

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/libstd/io/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ use option::{Option, Some, None};
use result::{Ok, Err};
use io::buffered::LineBufferedWriter;
use rt::rtio::{DontClose, IoFactory, LocalIo, RtioFileStream, RtioTTY};
use super::{Reader, Writer, io_error, IoError, OtherIoError,
standard_error, EndOfFile};
use super::{Reader, Writer, io_error, IoError, OtherIoError};

// And so begins the tale of acquiring a uv handle to a stdio stream on all
// platforms in all situations. Our story begins by splitting the world into two
Expand Down Expand Up @@ -202,10 +201,7 @@ impl Reader for StdReader {
// return an actual EOF error, but apparently for stdin it's a
// little different. Hence, here we convert a 0 length read to an
// end-of-file indicator so the caller knows to stop reading.
Ok(0) => {
io_error::cond.raise(standard_error(EndOfFile));
None
}
Ok(0) => None,
Ok(amt) => Some(amt as uint),
Err(e) => {
io_error::cond.raise(e);
Expand Down