diff --git a/.gitattributes b/.gitattributes index 8072a3ab3..783bc8543 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,5 @@ # normalize newlines -* text=auto -*.fish text -*.bat eol=crlf +* text=auto eol=lf # let git show off diff hunk headers, help git diff -L: # https://git-scm.com/docs/gitattributes diff --git a/src/fd_monitor.rs b/src/fd_monitor.rs index 3767dc4b2..28a986985 100644 --- a/src/fd_monitor.rs +++ b/src/fd_monitor.rs @@ -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"); } diff --git a/src/path.rs b/src/path.rs index 58954a501..7d7339d37 100644 --- a/src/path.rs +++ b/src/path.rs @@ -667,7 +667,7 @@ fn create_dir_all_with_mode>(path: P, mode: u32) -> st /// Return whether the given path is on a remote filesystem. pub fn path_remoteness(path: &wstr) -> DirRemoteness { let narrow = wcs2zstring(path); - #[cfg(target_os = "linux")] + #[cfg(any(target_os = "linux", cygwin))] { let mut buf = MaybeUninit::uninit(); if unsafe { libc::statfs(narrow.as_ptr(), buf.as_mut_ptr()) } < 0 { @@ -701,7 +701,7 @@ pub fn path_remoteness(path: &wstr) -> DirRemoteness { } } } - #[cfg(not(target_os = "linux"))] + #[cfg(not(any(target_os = "linux", cygwin)))] { fn remoteness_via_statfs( statfn: unsafe extern "C" fn(*const i8, *mut StatFS) -> libc::c_int,