mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-27 00:21:15 -03:00
Handle cygwin select() returning -1 with errno 0
This commit is contained in:
@@ -389,7 +389,9 @@ fn run(self) {
|
||||
drop(data);
|
||||
let ret =
|
||||
fds.check_readable(timeout.map(Timeout::Duration).unwrap_or(Timeout::Forever));
|
||||
if ret < 0 && !matches!(errno().0, libc::EINTR | libc::EBADF) {
|
||||
// Cygwin reports ret < 0 && errno == 0 as success.
|
||||
let err = errno().0;
|
||||
if ret < 0 && !matches!(err, libc::EINTR | libc::EBADF) && !(cfg!(cygwin) && err == 0) {
|
||||
// Surprising error
|
||||
perror("select");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user