trying common codepath for every unixes
This commit is contained in:
parent
a7be5bf683
commit
70e0f69632
@ -1552,18 +1552,6 @@ fn get_path(_fd: c_int) -> Option<PathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "freebsd",
|
||||
target_os = "hurd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "vxworks",
|
||||
target_os = "solaris",
|
||||
target_os = "illumos",
|
||||
target_os = "haiku",
|
||||
target_vendor = "apple",
|
||||
))]
|
||||
fn get_mode(fd: c_int) -> Option<(bool, bool)> {
|
||||
let mode = unsafe { libc::fcntl(fd, libc::F_GETFL) };
|
||||
if mode == -1 {
|
||||
@ -1577,23 +1565,6 @@ fn get_mode(fd: c_int) -> Option<(bool, bool)> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(
|
||||
target_os = "linux",
|
||||
target_os = "freebsd",
|
||||
target_os = "hurd",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "vxworks",
|
||||
target_os = "solaris",
|
||||
target_os = "illumos",
|
||||
target_os = "haiku",
|
||||
target_vendor = "apple",
|
||||
)))]
|
||||
fn get_mode(_fd: c_int) -> Option<(bool, bool)> {
|
||||
// FIXME(#24570): implement this for other Unix platforms
|
||||
None
|
||||
}
|
||||
|
||||
let fd = self.as_raw_fd();
|
||||
let mut b = f.debug_struct("File");
|
||||
b.field("fd", &fd);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit ccf4c38bdd73f1a37ec266c73bdaef80e39f8cf6
|
||||
Subproject commit 57ae1a3474057fead2c438928ed368b3740bf0ec
|
Loading…
Reference in New Issue
Block a user