mirror of
https://github.com/freemkv/libfreemkv.git
synced 2026-10-07 18:13:10 +00:00
Fix macOS optical E1000: hold a DiskArbitration claim for the session
The macOS SCSI transport took exclusive SCSI access plus a one-shot `diskutil unmountDisk`, but never claimed the disc from DiskArbitration. diskarbitrationd was therefore free to remount the volume mid-rip (a Spotlight re-probe is the usual trigger), yanking the device out from under an in-progress read; the failure surfaced to the user as E1000. Hold a DADiskClaim plus a mount-approval dissenter scoped to our disc for the transport lifetime, so the OS cannot remount it until shim_close(). Link the DiskArbitration framework in build.rs.
This commit is contained in:
@@ -5,6 +5,7 @@ fn main() {
|
||||
if target == "macos" {
|
||||
println!("cargo:rustc-link-lib=framework=IOKit");
|
||||
println!("cargo:rustc-link-lib=framework=CoreFoundation");
|
||||
println!("cargo:rustc-link-lib=framework=DiskArbitration");
|
||||
|
||||
let out_dir = std::env::var("OUT_DIR").unwrap();
|
||||
let obj = format!("{out_dir}/macos_shim.o");
|
||||
|
||||
Reference in New Issue
Block a user