Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

opt: remove manual flock on Windows

XDLCS4352193ff3c8
diff --git a/moli-browser-profile/src/profile_lock.rs b/moli-browser-profile/src/profile_lock.rs
index 4f81d4990..8bdfab646 100644
--- a/moli-browser-profile/src/profile_lock.rs
+++ b/moli-browser-profile/src/profile_lock.rs
@@ -15,6 +15,10 @@ use crate::BrowserProfilePaths;
#[derive(Debug)]
pub struct BrowserProfileLock {
path: PathBuf,
+ /// Held only on Unix, where the file descriptor keeps the advisory `flock`
+ /// alive for the lifetime of the guard. On non-Unix platforms the lock is
+ /// the file's existence on disk, so no handle needs to be retained.
+ #[cfg(unix)]
file: File,
remove_on_drop: bool,
}
@@ -55,6 +59,7 @@ pub fn acquire_profile_lock(paths: &BrowserProfilePaths) -> Result<BrowserProfil
Ok(BrowserProfileLock {
path: paths.lock_path.clone(),
+ #[cfg(unix)]
file,
remove_on_drop,
})
diff --git a/moli-layout/src/system_fonts.rs b/moli-layout/src/system_fonts.rs
index 75d99459a..2ff302674 100644
--- a/moli-layout/src/system_fonts.rs
+++ b/moli-layout/src/system_fonts.rs
@@ -77,6 +77,7 @@ fn normalized_family_name(name: &str) -> String {
name.chars().flat_map(char::to_lowercase).collect()
}
+#[cfg(any(test, target_os = "linux", target_os = "freebsd"))]
fn explicit_substitution_prefix<'a>(
requested: &'a [String],
default_families: &[String],