1
1
mirror of https://github.com/wez/wezterm.git synced 2024-08-17 02:00:25 +03:00

windows: handle broken pipe on read and treat as 0 bytes read

This commit is contained in:
Wez Furlong 2019-06-18 20:05:47 -07:00
parent ea0d3a0ed1
commit 56a0de9362

View File

@ -188,7 +188,12 @@ impl io::Read for FileDescriptor {
)
};
if ok == 0 {
Err(IoError::last_os_error())
let err = IoError::last_os_error();
if err.kind() == std::io::ErrorKind::BrokenPipe {
Ok(0)
} else {
Err(err)
}
} else {
Ok(num_read as usize)
}