Skip to content

Commit 7bd20b1

Browse files
fix: resolve macOS build errors and warnings
1 parent 8cd2e4b commit 7bd20b1

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ windows = { version = "0.58", features = [
4242

4343
# Unix-specific dependencies (macOS, Linux)
4444
[target.'cfg(unix)'.dependencies]
45-
nix = { version = "0.29", features = ["process", "signal", "fs"] }
45+
nix = { version = "0.29", features = ["process", "signal", "fs", "resource"] }
4646
libc = "0.2"
4747

4848
[profile.release]

src/backend.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ fn next_proxy_id() -> u64 {
2525
/// Backend instance state
2626
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2727
pub enum BackendState {
28-
Spawning,
2928
Ready,
3029
Stopping,
3130
Dead,

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ impl Drop for SingleInstanceLock {
7878

7979
#[cfg(unix)]
8080
fn acquire_single_instance_lock() -> Result<SingleInstanceLock> {
81-
use nix::fcntl::{flock, FlockArg};
82-
use std::os::unix::io::AsRawFd;
81+
use nix::fcntl::{Flock, FlockArg};
82+
use std::os::unix::io::AsFd;
8383

8484
let lock_path = std::env::var("HOME")
8585
.map(|h| std::path::PathBuf::from(h).join(".mcp-proxy.lock"))
@@ -91,7 +91,7 @@ fn acquire_single_instance_lock() -> Result<SingleInstanceLock> {
9191
.mode(0o600)
9292
.open(&lock_path)?;
9393

94-
match flock(file.as_raw_fd(), FlockArg::LockExclusiveNonblock) {
94+
match Flock::lock(file.as_fd().try_clone_to_owned()?, FlockArg::LockExclusiveNonblock) {
9595
Ok(_) => Ok(SingleInstanceLock { _file: file, path: lock_path }),
9696
Err(nix::errno::Errno::EWOULDBLOCK) => {
9797
anyhow::bail!("mcp-proxy is already running (lock file: {})", lock_path.display());

0 commit comments

Comments
 (0)