mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 21:33:09 +00:00
Fix broken read_ni() not making fd non-blocking on Linux
The incorrect order of operations was being used since && binds tighter than || in rust (as with most sane languages). Under Linux, EAGAIN == EWOULDBLOCK so this would always succeed in the case of a non-blocking fd without making the call to make_fd_nonblocking(). Comparing to the 3.7.0 C++ code, it looks like this was an oversight introduced in the migration to rust.
This commit is contained in:
parent
62a49acda3
commit
326d986186
1 changed files with 2 additions and 2 deletions
|
@ -709,8 +709,8 @@ fn read_ni(parser: &Parser, fd: RawFd, io: &IoChain) -> i32 {
|
|||
Err(err) => {
|
||||
if err == nix::Error::EINTR {
|
||||
continue;
|
||||
} else if err == nix::Error::EAGAIN
|
||||
|| err == nix::Error::EWOULDBLOCK && make_fd_blocking(fd).is_ok()
|
||||
} else if (err == nix::Error::EAGAIN || err == nix::Error::EWOULDBLOCK)
|
||||
&& make_fd_blocking(fd).is_ok()
|
||||
{
|
||||
// We succeeded in making the fd blocking, keep going.
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue