Merge pull request #11681

This commit is contained in:
Johannes Altmanninger
2025-07-25 17:56:24 +02:00
3 changed files with 6 additions and 6 deletions

4
.gitattributes vendored
View File

@@ -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

View File

@@ -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");
}

View File

@@ -667,7 +667,7 @@ fn create_dir_all_with_mode<P: AsRef<std::path::Path>>(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<StatFS, Flags>(
statfn: unsafe extern "C" fn(*const i8, *mut StatFS) -> libc::c_int,