Skip to content

Commit

Permalink
Add DragonFly support via FreeBSD codepath
Browse files Browse the repository at this point in the history
DragonFly has `getmntinfo` for `statfs` and `getmntvinfo` for `statvfs`.
Use `statfs` variant for compatibility with FreeBSD and OpenBSD.

error[E0425]: cannot find function `get_mount_points` in this scope
  --> czkawka-6.0.0/cargo-crates/trash-3.0.2/src/freedesktop.rs:31:28
   |
31 |         let mount_points = get_mount_points()?;
   |                            ^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `get_mount_points` in this scope
  --> czkawka-6.0.0/cargo-crates/trash-3.0.2/src/freedesktop.rs:80:24
   |
80 |     let mount_points = get_mount_points()?;
   |                        ^^^^^^^^^^^^^^^^ not found in this scope
  • Loading branch information
jbeich committed Oct 18, 2023
1 parent aa6fd20 commit ed1984b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ scopeguard = "1.2.0"
url = "2.4.1"
once_cell = "1.18.0"

[target.'cfg(any(target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
[target.'cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
once_cell = "1.7.2"

[target.'cfg(windows)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/freedesktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ fn get_mount_points() -> Result<Vec<MountPoint>, Error> {
Ok(result)
}

#[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
#[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))]
fn get_mount_points() -> Result<Vec<MountPoint>, Error> {
use once_cell::sync::Lazy;
use std::sync::Mutex;
Expand Down

0 comments on commit ed1984b

Please sign in to comment.