Skip to content

Commit 2923f3a

Browse files
hkratzpietroalbini
authored andcommitted
Fuchsia apparently does not have DT_UNKNOWN.
1 parent cb88166 commit 2923f3a

File tree

1 file changed

+10
-1
lines changed
  • library/std/src/sys/unix

1 file changed

+10
-1
lines changed

library/std/src/sys/unix/fs.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1639,11 +1639,20 @@ mod remove_dir_impl {
16391639
None
16401640
}
16411641

1642+
#[cfg(target_os = "fuchsia")]
1643+
fn is_dir(ent: &DirEntry) -> Option<bool> {
1644+
match ent.entry.d_type {
1645+
libc::DT_DIR => Some(true),
1646+
_ => Some(false),
1647+
}
1648+
}
1649+
16421650
#[cfg(not(any(
16431651
target_os = "solaris",
16441652
target_os = "illumos",
16451653
target_os = "haiku",
1646-
target_os = "vxworks"
1654+
target_os = "vxworks",
1655+
target_os = "fuchsia"
16471656
)))]
16481657
fn is_dir(ent: &DirEntry) -> Option<bool> {
16491658
match ent.entry.d_type {

0 commit comments

Comments
 (0)