Skip to content

Commit ce9e875

Browse files
gzmatthiasbeyer
authored andcommitted
Fixes eof detection with nightly
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
1 parent 3a5fa86 commit ce9e875

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/reader.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ impl NBReader {
171171
// this is just from experience, e.g. "sleep 5" returns the other error which
172172
// most probably means that there is no stdout stream at all -> send EOF
173173
// this only happens on Linux, not on OSX
174-
Err(PipeError::IO(ref err)) if err.kind() == io::ErrorKind::Other => {
175-
self.eof = true
174+
Err(PipeError::IO(ref err)) => {
175+
// For an explanation of why we use `raw_os_error` see:
176+
// https://github.com/zhiburt/ptyprocess/commit/df003c8e3ff326f7d17bc723bc7c27c50495bb62
177+
self.eof = err.raw_os_error() == Some(5)
176178
}
177-
// discard other errors
178-
Err(_) => {}
179179
}
180180
}
181181
Ok(())

0 commit comments

Comments
 (0)