Skip to content

Commit

Permalink
fix the macos compile issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joinhack committed Jul 29, 2024
1 parent 30af381 commit eeefe01
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/wasi/src/nat/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ pub(crate) fn pfctl() -> Result<(), NatError> {

/// write the archors file
pub(crate) fn write_anchors(name: &str) -> Result<(), NatError> {
let mut pfctl = OpenOptions::new()
let mut pfctl = io_wrap!(OpenOptions::new()
.write(true)
.create(true)
.open("/etc/pf.anchors/bls-vm-nat")?;
.open("/etc/pf.anchors/bls-vm-nat"));
let cmd = format!("nat on en0 from {name}:network to any -> (en0)\n");
pfctl.write_all(cmd.as_bytes())?;
io_wrap!(pfctl.write_all(cmd.as_bytes()));
Ok(())
}

0 comments on commit eeefe01

Please sign in to comment.