From ed1984b923a7cdd7dbf03484d02b5da07e27779c Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Wed, 18 Oct 2023 13:15:35 +0200 Subject: [PATCH] Add DragonFly support via FreeBSD codepath 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 --- Cargo.toml | 2 +- src/freedesktop.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b39449..952a0a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/src/freedesktop.rs b/src/freedesktop.rs index c926990..90f819e 100644 --- a/src/freedesktop.rs +++ b/src/freedesktop.rs @@ -678,7 +678,7 @@ fn get_mount_points() -> Result, 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, Error> { use once_cell::sync::Lazy; use std::sync::Mutex;